Hi programmers,
I'm facing the following task:
I have the file "c:\folder\a.txt" with the following content:
a
b
a
b
c
So I use the following batch:
find "a" < c:\folder\a.txt >> c:\folder\b.txt
and I obtain the c:\folder\b.txt with the following content:
a
a
Now, what if I want to add a string after every line? To obtain for example the following output:
a;
a;
is it possible?
Thanks
edit lines in FIND comand
Moderator: DosItHelp
Re: edit lines in FIND comand
It is possible with for command.Mado91 wrote: ↑07 Apr 2020 15:08Hi programmers,
I'm facing the following task:
I have the file "c:\folder\a.txt" with the following content:
a
b
a
b
c
So I use the following batch:
find "a" < c:\folder\a.txt >> c:\folder\b.txt
and I obtain the c:\folder\b.txt with the following content:
a
a
Now, what if I want to add a string after every line? To obtain for example the following output:
a;
a;
is it possible?
Thanks
Code: Select all
FOR /F "tokens=*" %%A IN ('find "a" ^< C:\Users\USER\Documents\NUM.txt') DO echo %%A;>> output.txt
Also, TEST_>> OUTPUT.txt will add unnecessary space at the end of every line. like this:
Code: Select all
Output:
TEST_
TEST_
Re: edit lines in FIND comand
Thank a lot! It worked fine.
I tried the for comand too before asking but I was misswriting the syntax, basically because of the use of apex ^.
Thanks again
I tried the for comand too before asking but I was misswriting the syntax, basically because of the use of apex ^.
Thanks again