after struggling in the geany editor to get regex to work, i tried a different approach.
say you have a file, test.txt, with the following content:
menu2.getChildren().add(createMenuItem("none", userNorwegian ? ...
menu2.getChildren().add(createMenuItem("none", userEnglish ? ...
menu2.getChildren().add(createMenuItem("none", userNorwegian ? ...
menu2.getChildren().add(createMenuItem("none", userEnglish ? ...
but you only want a file with the lines containing the string userNorwegian, i.e. you want to remove the lines containing userEnglish.
open a terminal and run this:
sed -n 's/userNorwegian/userNorwegian/p' test.txt > out.txt
-n means:
suppress automatic printing of pattern space
p means:
Print the current pattern space.
keep it simple, stupid! ;)
thanks for the idea here:
http://stackoverflow.com/a/8255627/557194
IT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment