Jump to content

Recommended Posts

Posted

hi, all.

how can I erase lines from the end of file after opening it for edit:

$file=FileOpen  ("c:\0522554720.htm",1)

I want to erase lines from the end of the file.

Posted

_FileReadtoArray

The for loop, and filewriteline.

But how do you not write the last lines? The secret is in the to of the for loop. see if you can work it out. Hint, expressions can be used... :)

Posted

You could use _FileCountLines to get the number of the last line in the file and then use _FileWriteToLine without any text to delete the line without having to open the file.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

You could use _FileCountLines to get the number of the last line in the file and then use _FileWriteToLine without any text to delete the line without having to open the file.

Thanks for your responses,

I'v choose the :

$filechange=_FileWriteToLine("c:\0522554720.htm",85, "my replacement for line 85", 1)

it erases the part i don't need from previus action and replaces it with new data continuasly. instead of using "my r...." i will use an $i string that allways changes.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...