![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perform action file name written to the pipe | fed.linuxgossip | Shell Programming and Scripting | 2 | 07-23-2008 07:38 AM |
| Clean File | kris01752 | UNIX for Advanced & Expert Users | 5 | 09-28-2006 07:40 AM |
| Clean Text File | kris01752 | UNIX for Advanced & Expert Users | 1 | 08-24-2006 11:48 AM |
| Compare 2 different file version and prompt for action | systemali | Shell Programming and Scripting | 0 | 03-19-2006 11:58 PM |
| make and clean in a single rule in the makefile. | vino | UNIX for Dummies Questions & Answers | 4 | 04-26-2005 10:12 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Clean file in single action
What one finds challenging another finds simple...
(HPUX B.11.11) I have a text file named something like 12345.dst that could look like this: DOG CAT NONE TEST CAT What I want to end up with is 12345.dst looking like this: CAT DOG TEST removing "NONE" should it be there and doing the equivalent of "sort -u" on the remains. I know how to get out the "NONE" in a one-liner: /bin/echo "g/^NONE$/d\nwq!" | ex -s 12345.dst Is there a way to add in the functional equivalent of a "sort -u" to this command line? Thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Have you thought about:
grep -v -w NONE 12345.dst |sort -u |
|||
| Google The UNIX and Linux Forums |