Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding the filename to the file.

Status
Not open for further replies.

Phreeneazie

Technical User
Apr 6, 2003
27
GB
Hi,

as some of you will already know, I don't have much knowledge with VBScript....

I am in need of a script that will take a file, open it and on the top line of that file, add the name of the file to it. For instance...

The name of the file is "DTF0001.txt" and the file might contain:

Line1: xxxxxxxxxxxxxx
Line2: xxxxxxxxxxxxxx
Line3: xxxxxxxxxxxxxx
Line4: xxxxxxxxxxxxxx
etc...

I need to have the file look like this:

Line1: DTF0001.txt
Line2: xxxxxxxxxxx
Line3: xxxxxxxxxxx
Line4: xxxxxxxxxxx
Line5: xxxxxxxxxxx
etc.

Also, the file will change daily - usually it will increment by 1 - DTF0001.txt; DTF0002.txt so ideally, I would need to pick up DTF*.* There wouldn't be a problem of picking up old files, because once used it will be automatically moved into an Archive directory.

Can anyone help? Thanks to all!
 
And what have you so far ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PH,

I have nothing so far! When I say I don't have much knowledge, that's perhaps an understatement :( I wouldn't know where to start.
 
Do a keyword search in this forum for fso, you will get ton of useful post pretty good for learning and then come back with your code if you are still stuck.
Keep in mind that Tek-Tips is not an help desk and nobody here is supposed to do your job nor write for you complete solution.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top