Hi.
I'm trying to remove a line from a file that holds user profiles. The file is as follows:
So I have a form which can select which username to delete, but I don't know how to actually delete a specific line from the text file. Can anyone point me in the right direction?
One idea I have was to create a 2nd file, reading each line except that of the one I wish to remove, then rename the new file to the original filename. There must be an easier way to do this?!
Many Thanks
I'm trying to remove a line from a file that holds user profiles. The file is as follows:
Code:
admin:god:group1:ksh:1
user1:pass1:group1:bash:1
user2:pass1:group2:bash:0
user3:pass1:group3:bash:1
user4:pass1:group4:bash:0
One idea I have was to create a 2nd file, reading each line except that of the one I wish to remove, then rename the new file to the original filename. There must be an easier way to do this?!
Many Thanks