Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all,
this is my first post, please be patient :-)
this is my text file:
5326
71 e
68 di
39 €
26 del
25 per
25 in
22 il
22 ebay
20 eur
19 la
19 iphone
16 Â
15 nero
15 a
and so on...........
it contains the occurences of words in a text file but i need to delete lines containing italians adverbs or conjunctions (like "per", "di" or "e"); i tried like this:
Code:
sed -e 's/e//g' output.txt > output2.txt
but this instruction delete ALL LINES CONTAINING CHAR "e"...
i tried also this:
Code:
sed -e 's/ e/n//g' output.txt > output2.txt
but nothing...
Any suggestion? Thanks
Last edited by DarkLight90; 06-28-2012 at 08:14 AM.
Not sure if you have already looked at this, since the last comment was to use grep, but i'll give some input.
The -w flag for grep will match standalone words, so if you have a line like this: (test.txt)
This is a line without that letter as a standalone word
This is a e line for testing
This command will only return the second line:
Code:
cat test.txt | grep -w "e"
Yeah u are right motel, i was thinking right now at this but there is no "-exec" for "sed" command, so i don't know how to do a pipe of instructions for deleting what i don't need (selecting whit grep)... also "tr" don't implement this function...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.