Search a text file, copy lines with matches to a separate file
by grumpyskeptic from LinuxQuestions.org on (#55PEF)
I have a text file I want to search for particular strings. If a match is found, then I want that whole line to be copied to a separate file. Any further matching lines will be appended to that file.
For example if I am searching for the string "app" then will find a match in the line "Strawberries, Oranges, Pears, Apples, Grapes" and copies that whole line to another file. When it finds other matches then these lines are appended to the other file.
I would prefer something with a GUI.
The text file is maybe two or three thousand lines long.
I am using Linux Mint 17.3 Rosa Cinnamon.
Thanks.


For example if I am searching for the string "app" then will find a match in the line "Strawberries, Oranges, Pears, Apples, Grapes" and copies that whole line to another file. When it finds other matches then these lines are appended to the other file.
I would prefer something with a GUI.
The text file is maybe two or three thousand lines long.
I am using Linux Mint 17.3 Rosa Cinnamon.
Thanks.