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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Set oFS = Server.CreateObject("Scrip ting.FileS ystemObjec t")
Set oReadFile = oFS.OpenTextFile("C:\temp\ readfile.t xt")
If Not oFS.FileExists("C:\temp\wr itefile.tx t") Then oFs.CreateTextFile("C:\tem p\writefil e.txt")
Set oWriteFile = oFs.OpenTextFile("C:\temp\ writefile. txt",8)
Set oReadFile = oFS.OpenTextFile("C:\temp\
If Not oFS.FileExists("C:\temp\wr
Set oWriteFile = oFs.OpenTextFile("C:\temp\
ASKER
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!