woody_woodz Posted December 29, 2005 Posted December 29, 2005 I need to read a very long .txt file, add , delete or modify some rows and then save the resulting file as other .txt fileThe data in the original file looks like this:<empty row>somedata1somedata2somedata3<empty row>somedata1somedata2somedata3somedata4somedata5<empty row>......and so on.The second file :<empty row>newdata1newdata2somedata1modified _data2somedata3<empty row>newdata1newdata2somedata1modified_data2somedata3somedata4somedata5<empty row>.....and so onI managed to do an VBS script that opens a series of excel files runs a VBA macro and then closes the excels. Problem is, because of the many rows in the txt file, it's going sooooooo slowly and it will be nice not to install MsOffice or .NET Framework just to do this ; and after all why use VBA & Excel when I am almost sure VBS can handle the problem just fine.Any ideeas ? Thanks
IcemanND Posted December 29, 2005 Posted December 29, 2005 open two textstreams, one for reading your existing file, one for writeing the modified data. then as you read each line write the line to the other file or modify/add and write it to the second file.
gunsmokingman Posted December 30, 2005 Posted December 30, 2005 Go to this link Hey Scripting Guys, Text Files there should be some thing there to helpyou do what you want.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now