sandy1028 Posted February 19, 2010 Share Posted February 19, 2010 vi test.txt sun sun moon star moon Now when I execute the command, cat test.txt | grep sun > sun.txt text "sun" is copied to a file. I need a help how to delete the lines which has "sun" from text.txt and save the file. Link to comment https://forums.phpfreaks.com/topic/192639-delete-lines-from-text-file-after-copying-to-a-another-file/ Share on other sites More sharing options...
steviewdr Posted February 19, 2010 Share Posted February 19, 2010 cat text.txt | grep sun > sun.txt | sed -i "/sun/d" text.txt -steve Link to comment https://forums.phpfreaks.com/topic/192639-delete-lines-from-text-file-after-copying-to-a-another-file/#findComment-1014875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.