i need to incert a text if condition mets

June 27, 2009 at 13:34:14
Specs: Windows XP
i have a file named "incert.txt".
i have lines..as
0001 a _xyz
0002 a _abc...
i need a batch file which replace first 00 as 02 and add prefix "_KL" to all lines in my txt file and store another file.
the final output should be....like this
0201 a _KL_xyz
0202 a _KL_abc.....

thanks in advance......


See More: i need to incert a text if condition mets

Report •


#1
June 27, 2009 at 19:55:56
I know this might not be what you are wanting, but it might be easier to load the file into word and do a find/replace.

Find 000 Replace with 020
Find a _ Replace with a _KL_

Then simply save the file as text to whatever name you like.

So far as I know, Batch language is too limited to do a line by line read and accomplish what you're wanting here. You could try setting a macro in Excel or Word, or research extended batch, but for now the above would be a simple temporary solution.


Report •
Related Solutions


Ask Question