Link to home
Start Free TrialLog in
Avatar of LotharGores
LotharGores

asked on

Read and write into a DB text file

Hi,
I have two text files text1.txt and text2.dat
Text1.txt contains data which i would like to manipulate and then write the modifications to text2.dat

How do I read line for line in text1.txt modify the string and than write it line for line to text2.dat? Do not worry about the the modification bit, I know how to do that. I am only interested in the reading and wrting part.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LotharGores
LotharGores

ASKER

Hi sybe,
can you provide me with some code to check "writefile.txt" exists - and if not to create it!

thanks for the above code works just fine!
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
Set oReadFile = oFS.OpenTextFile("C:\temp\readfile.txt")
If Not oFS.FileExists("C:\temp\writefile.txt") Then oFs.CreateTextFile("C:\temp\writefile.txt")
Set oWriteFile = oFs.OpenTextFile("C:\temp\writefile.txt",8)