Computing.Net > Forums > Programming > Open text file, insert CR on line and save

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.

Open text file, insert CR on line and save

Reply to Message Icon

Name: squibcakes
Date: October 13, 2009 at 19:05:07 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Hi I have a text file that looks like this:

0x19, 0x01, //comments
0x29, 0x02, //comments
0x15, 0x00, //comments

How can I split the lines so it looks like this:

0x19,
0x01, //comments
0x29,
0x02, //comments
0x15,
0x00, //comments

And resave the file.

Thanks
Squib



Sponsored Link
Ads by Google

Response Number 1
Name: gtaion
Date: October 13, 2009 at 19:26:12 Pacific
Reply:

Try making a Batch file like this. It will save the output to a new file in the same directory as the batch.


@echo off
For /f "tokens=1,*" %%a in (Text.txt) do (
echo %%a >> New.txt
echo %%b >> New.txt
)


1

Response Number 2
Name: squibcakes
Date: October 13, 2009 at 23:48:48 Pacific
Reply:

Yep thats it. Thankyou very much.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Open text file, insert CR on line and save

new line after n'th character in text file www.computing.net/answers/programming/new-line-after-nth-character-in-text-file/19623.html

Text file import www.computing.net/answers/programming/text-file-import/6371.html

text file manipulation in c++ www.computing.net/answers/programming/text-file-manipulation-in-c/11944.html