Computing.Net > Forums > Programming > Batch to append text to each line of a txt

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.

Batch to append text to each line of a txt

Reply to Message Icon

Name: jbravo
Date: May 7, 2009 at 07:58:12 Pacific
OS: Windows XP pro
CPU/Ram: P4/512
Product: Dell / OPTIPLEX
Subcategory: Batch
Comment:

I need to append a fixed text string to the beginning of each line of a text file like this.
The first file is a dir list of filenames generated with dir /a:-d/b/o:n>list.txt I then want to add www.mysite.com\ before the data already on each line so I get.

www.mysite.com\1234.mp3
etc.
I then need to add it to another txt but I can do that. TIA



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: May 7, 2009 at 09:17:26 Pacific
Reply:

for /F "delims=" %%j in (list.txt) do echo.www.mysite.com\%%j >> ListNew.txt


0

Response Number 2
Name: jbravo
Date: May 8, 2009 at 09:54:53 Pacific
Reply:

sweet thank you I was using a much more complex method that didnt work anyway. Thanks again.


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: Batch to append text to each line of a txt

Count comma in each line of a text www.computing.net/answers/programming/count-comma-in-each-line-of-a-text-/17747.html

Remove top 6 lines of a text file www.computing.net/answers/programming/remove-top-6-lines-of-a-text-file/19324.html

One line of a .txt file in VB6 www.computing.net/answers/programming/one-line-of-a-txt-file-in-vb6/8248.html