Hello. There is a file with approximate content:
#text text2 text3 #text4 text5 I need to read the file line by line and if the first character of the line is not # written to another file as "some_text line_from_first_file". Ie having worked on the file from the example, the script should give me:
ΠΊΠ°ΠΊΠΎΠΉ-ΡΠΎ_ΡΠ΅ΠΊΡΡ text2 ΠΊΠ°ΠΊΠΎΠΉ-ΡΠΎ_ΡΠ΅ΠΊΡΡ text3 ΠΊΠ°ΠΊΠΎΠΉ-ΡΠΎ_ΡΠ΅ΠΊΡΡ text5 I tried this:
set file=file.txt for %%i in (%file%) do ( set test=%%i set var=%package:~0,1% if not "%var%" == "#" echo "ΠΊΠ°ΠΊΠΎΠΉ-ΡΠΎ_ΡΠ΅ΠΊΡΡ %test%" >> new_file.txt ) But nothing works. Advised:
for /f %%i in ('findstr /v ^# file.txt') do echo ΠΊΠ°ΠΊΠΎΠΉ-ΡΠΎ_ΡΠ΅ΠΊΡΡ %%i >> new_file.txt But also does not work. Thanks in advance for your help