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.
Delete text in .txt files with dos
Name: bulleke Date: April 8, 2005 at 05:30:20 Pacific OS: Windows XP CPU/Ram: 128 MB
Comment:
How can I delete "sheep" in a text file and put "horse" in it's place ps: sheep is always the first word in every line, so you could delete the word sheep and put horse in the beginning of evey line
If "in DOS" means Win XP/2K prompt, as I suspect, that can be achieved by For /F statement. Something as
For /F "tokens=1*" %%A in (Text_File) Do ( Echo horse %%B >> New_Text_File) Move New_Text_File Text_File /Y
but you get a solution only if you can understand it.
0
Response Number 4
Name: FishMonger Date: April 8, 2005 at 08:52:07 Pacific
Reply:
It would be a lot more efficient if you use any one of a number of scripting languages other than a DOS batch file. My personal preference would be Perl. This Perl command will do an inline edit of the file and create a backup copy of the original file.
Summary: Hey I have a .TXT file from windows event logger. There's hundreds of identical lines that all end with a different number. I need a script that will delete any lines where that integer is <12 s...
Summary: I am trying to create a batch file that will complete the action I need. It will always run in WinXP. I have been researching this for a couple of weeks, and I have not found the solution. *** Fir...
Summary: Hello, I want to generate a text-file that lists all folder and subfolders as: c:\foldername1\subfolder1\ and I want to proceed eacht folder line with a string: sting c:\foldername1\subfolder1\ sting...