This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Replacing a line

Old posts that have not been replied to for several years.
Locked
B
BlackJack

Replacing a line

Post by BlackJack »

Hey Guys,
i have a txt file with more than 1 line, in each line are more than 1 word.

now, i want to delete the whole line, if there is a specified word.

for example:

line1 - peter is a nice guy
line2 - peter is gay
line3 - peter is tall

now i want to delete the line, where "gay" is in and post the others again in the file like this:

line1 - peter is a nice guy
line3 - peter is tall

Can somebody tell me how to do this? I tryed it with lsearch and lreplace but i'm not very skilled and hope you will help me. THANKS!
Locked