Good evening everyone!
You need to write a regular expression that selects a line from the file and the lines following it, before the next key
For example, in the file a lot of different keys are described:
/P ΠΡΠ²ΠΎΠ΄ Π·Π°ΠΏΡΠΎΡΠΎΠ² ΠΏΠ΅ΡΠ΅Π΄ ΡΠΎΠ·Π΄Π°Π½ΠΈΠ΅ΠΌ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ Π½ΠΎΠ²ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°. /S ΠΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠΎΠ»ΡΠΊΠΎ Π½Π΅ΠΏΡΡΡΡΡ
ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠ² Ρ ΠΏΠΎΠ΄ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°ΠΌΠΈ. /E ΠΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠ² Ρ ΠΏΠΎΠ΄ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°ΠΌΠΈ, Π²ΠΊΠ»ΡΡΠ°Ρ ΠΏΡΡΡΡΠ΅. ΠΠΊΠ²ΠΈΠ²Π°Π»Π΅Π½ΡΠ΅Π½ ΡΠΎΡΠ΅ΡΠ°Π½ΠΈΡ ΠΊΠ»ΡΡΠ΅ΠΉ /S /E. Π‘ΠΎΠ²ΠΌΠ΅ΡΡΠΈΠΌ Ρ ΠΊΠ»ΡΡΠΎΠΌ/T. /C ΠΡΠΎΠ΄ΠΎΠ»ΠΆΠ΅Π½ΠΈΠ΅ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π²Π½Π΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΠΎΡ Π½Π°Π»ΠΈΡΠΈΡ ΠΎΡΠΈΠ±ΠΎΠΊ. I use the command FINDSTR /C: "/E " file.txt > lab.txt
With such an entry in the file will display the following line:
/E ΠΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠ² Ρ ΠΏΠΎΠ΄ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°ΠΌΠΈ, Π²ΠΊΠ»ΡΡΠ°Ρ ΠΏΡΡΡΡΠ΅. and I need to get it out:
/E ΠΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠ² Ρ ΠΏΠΎΠ΄ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°ΠΌΠΈ, Π²ΠΊΠ»ΡΡΠ°Ρ ΠΏΡΡΡΡΠ΅. ΠΠΊΠ²ΠΈΠ²Π°Π»Π΅Π½ΡΠ΅Π½ ΡΠΎΡΠ΅ΡΠ°Π½ΠΈΡ ΠΊΠ»ΡΡΠ΅ΠΉ /S /E. Π‘ΠΎΠ²ΠΌΠ΅ΡΡΠΈΠΌ Ρ ΠΊΠ»ΡΡΠΎΠΌ/T. Ie to get 2 lines and if there are 3 of them in the key, then 3 is described
Question: how to change the regular expression? command key to change to FINDSTR /R "ΡΠ΅Π³ΡΠ»ΡΡΠ½ΠΎΠ΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅" file.txt > file2.txt