Computing.Net > Forums > Programming > dos appending last line of text fil

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.

dos appending last line of text fil

Reply to Message Icon

Name: colmite
Date: July 29, 2005 at 15:08:17 Pacific
OS: windowsXP
CPU/Ram: 2gig ram 3.6ghz
Comment:

Hi there,
Can some one tell me how I can append text to the last line of a text file? I need to be able to have text added right after text that is currently on a text document.
I am using: echo my text>>test.txt

I am getting this text showing up at the end of a text docmument like this:
example1
my text

I need this data to actually be set like this:
example1my text

can anybody help me out with this? or tell me if there is a way to specify what line to put this text on?


thx



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: July 29, 2005 at 23:22:55 Pacific
Reply:

Difficult, at best, with DOS.

With NT CMD.exe, life gets easier.

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: colmite
Date: July 30, 2005 at 03:12:53 Pacific
Reply:

Can you tell me how to do this with NT.CMD or XP.CMD? this will actually be a script that I will run via the imaging process and can run this in DOS or in windows.

I really appreciate any help you an give.


thx


0

Response Number 3
Name: wizard-fred
Date: July 30, 2005 at 10:37:26 Pacific
Reply:

The problem is if the appended part appears on the next line, then you can't append. The file end with a new line command which has to be deleted so the appended part can appear on the same line.

My prefered method would be to write a utility program to test the line ending and rewrite the file as needed.

Hi M2.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: dos appending last line of text fil

Batch file to extract lines of text from .ini www.computing.net/answers/programming/batch-file-to-extract-lines-of-text-from-ini/19089.html

Delete Last line of a text file www.computing.net/answers/programming/delete-last-line-of-a-text-file/20179.html

Batch to del first x lines of text www.computing.net/answers/programming/batch-to-del-first-x-lines-of-text/16887.html