View Full Version : removing a line in a text file
duniyadnd
01-13-2003, 05:51 AM
Does anyone have any suggestion on how I can remove the first line of a text file? If it makes it any easier, each line in my file ends with a semi-colon.
Thanks
Duniyadnd
sir pannels
01-13-2003, 07:12 PM
maybe you could the contents of the file to an array, that way you can access certain line numbers.. and just access and delete line 0.
P :cool:
duniyadnd
01-13-2003, 07:56 PM
yeah, i tried that, however, it doesn't remove the line, it just writes over, and at the end of it, I still have a portion of my last line repeating.
That's why I have to either remove the top line, or empty the file as a solution.
The thing is that I want the text file not to exceed 100 lines, so everytime there's a new entry, it would remove the first line, and then add in the new entry as the 100th.
Duniyadnd
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.