Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
editing text file with batch file
Name: nexeon Date: April 12, 2007 at 15:17:36 Pacific OS: XP CPU/Ram: Pentium Product: inspiron
Comment:
I have a text file which has more then 10000 lines in it. I want to add a < in the begining of each line and > at the end of each line through a batch run. Can anyone provide me with a batch file that could could automaticallyperform this task
Name: IVO Date: April 13, 2007 at 02:39:57 Pacific
Reply:
@Echo Off For /F "tokens=* delims=" %%J in (myfile_in.txt) Do ( Echo.^<%%J^>>>myfile_out.txt)
0
Response Number 2
Name: nexeon Date: April 13, 2007 at 07:47:48 Pacific
Reply:
Hello IVO, Thanks for the reply
I created a batch file with this content:
@Echo Off For /F "tokens=* delims=" %%J in (C:\Documents and Settings\admin\My Documents\email test.txt) Do ( Echo.^<%%J^>>>C:\Documents and Settings\admin\My Documents\email test1.txt)
It did not do anything
Ram Ethindra
0
Response Number 3
Name: Shr0Om Date: April 13, 2007 at 13:03:21 Pacific
Reply:
Did you tried quotation around the path?
("C:\Documents and Settings\admin\My Documents\email test.txt")
If that doesnt help, remove "echo off", and then run the batch from the command shell so you can see what errors that occur.
0
Response Number 4
Name: wizard-fred Date: April 14, 2007 at 04:09:27 Pacific
Reply:
If a batch file doesn't do it, any halfway decent text processor with search and replace should be able to do all but the first and last lines which you can fix manually.
0
Response Number 5
Name: IVO Date: April 14, 2007 at 09:41:50 Pacific
Reply:
@Echo Off For /F "tokens=* delims=" %%J in ('Type "C:\Documents and Settings\admin\My Documents\email test.txt"') Do ( Echo.^<%%J^>>>"C:\Documents and Settings\admin\My Documents\email test1.txt")
If a batch file doesn't do it, that almost always is due to the poor knowledge of the basic principles of scripting and NT/DOS statements as "" to mark pathnames with embedded blanks and more advanced rules as those that force here to use a command ('Type...') clause for the For /F statement.
Summary: So I need to make a batch file to change a single word in a text file. For example, in a file.txt file there are lines, this is a text file I want to be able to change the word text to awesome. I hop...
Summary: Hi, what I am trying to do is make a batch file that will edit a text file. here is what my text file looks like: THISFORM.LISTARRAY(1)="Alachua" THISFORM.LISTARRAY(1)="Altamonte Springs" THISFORM.LIS...
Summary: PROBLEM 1. UNKNOWN SOME EMPLOYEE IS CHANGING THE COMPUTER SYSTEM CLOCK TO MANIPULATE THE TIME STAMPS THEN RUNNING ATOMIC CLOCK TO RESET IT 2. I NEED TO CREATE INSTANT RETIREMENT PROGRAM FOR THE EMPL...