Computing.Net > Forums > Programming > batch file help

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 file help

Reply to Message Icon

Name: elfudge35
Date: March 2, 2006 at 09:05:50 Pacific
OS: XP
CPU/Ram: Pentium 4, 512 mb
Product: IBM ThindPad
Comment:

I need to create a batch file to insert the file name into the first line of approximately 700,000 text files, can anybody help?



Sponsored Link
Ads by Google

Response Number 1
Name: shahramsh
Date: March 2, 2006 at 16:41:45 Pacific
Reply:

if you don't care about a "" sign at the end, this might help

====================
@echo off
md done
copy mtext.txt+%1 done\%1
====================

where mtext.txt is:
====================
Your Text

====================

or you could use a "for" command to append it line by line, but I wouldn't use it for my sensitive texts


0

Response Number 2
Name: Mechanix2Go
Date: March 2, 2006 at 23:07:56 Pacific
Reply:

Try this:

::== nameinto.bat
@echo off

for %%T in (*.txt) do call :sub1 %%T
goto :eof

:sub1

echo %1>#
copy /b #+%1 ## > nul
del %1
ren ## %1
goto :eof
:: DONE


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

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: batch file help

batch file help www.computing.net/answers/programming/batch-file-help/13830.html

Batch File Help www.computing.net/answers/programming/batch-file-help-/11464.html

batch file help www.computing.net/answers/programming/batch-file-help/190.html