IonicWind Software

IWBasic => General Questions => Topic started by: Brian on May 14, 2011, 04:02:33 AM

Title: Re-writing files
Post by: Brian on May 14, 2011, 04:02:33 AM
Hello,

I need to open a sequence of text files, take out the first line, and then
write them back with the same filename

Any ideas as to how best achieve this? I'm not bothered about code,
just the best and most efficient way to do it

Thanks,

Brian
Title: Re: Re-writing files
Post by: LarryMc on May 14, 2011, 05:25:52 AM
when I do that sort of thing I open a second, temp, file.
read all the first and write to the second
close the 1st, delete it.
rename the 2nd to the name of the 1st.

It's easy to code.

LarryMc