![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Removing duplicates in a sorted file by field. | kinksville | Shell Programming and Scripting | 1 | 04-29-2008 11:03 AM |
| Removing parts of a specific field | kieranh | Shell Programming and Scripting | 9 | 09-28-2007 09:52 AM |
| removing line and duplicate line | ocelot | UNIX for Dummies Questions & Answers | 11 | 01-30-2007 09:44 AM |
| Replacing the last field of a line. | Darek | Shell Programming and Scripting | 3 | 08-19-2005 08:45 AM |
| AWK line by line instead of field by field? | yongho | Shell Programming and Scripting | 2 | 07-06-2005 02:49 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a text file containing
/database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph i want the last field after "/" removed like /database/sp/ /database/tables/ /mib/ /mib/ /scripts/operations/ntr/ plz help |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Care to read the manpages ? Look at man dirname
|
|
#3
|
|||
|
|||
|
Code:
for line in `cat file.txt`; do dirname $i; done |
|
#4
|
|||
|
|||
|
Are you looking for
cat file | awk -F "/" '{print $NF}' ?? Regds, Kaps |
|
#5
|
|||
|
|||
|
Ooops , you wanted
cat file | xargs -n1 dirname Regds, Kaps |
|||
| Google The UNIX and Linux Forums |