![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to replace the first word of a line if it occurs again in the next line(shell) | geeko | Shell Programming and Scripting | 4 | 06-18-2009 02:36 PM |
| Read line by line not word by word | vadharah | Shell Programming and Scripting | 6 | 03-02-2008 02:29 PM |
| to get a line above the search word | sachin.gangadha | UNIX for Dummies Questions & Answers | 16 | 01-07-2008 07:19 AM |
| Can a shell script pull the first word (or nth word) off each line of a text file? | tricky | Shell Programming and Scripting | 5 | 08-17-2006 06:29 AM |
| How to read from a file line by line and do stuff | spaceship | Shell Programming and Scripting | 4 | 03-17-2005 09:47 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
query on how to search for a line and read 4th word from that line
Assume I have a text file as below:
me con pi ind ken pras ur me con rome ind kent pras urs pintu con mys ind pan pras ki con kit ind sys My requirement, I need to search for "con rome" and if exists, then print 4th word from rome, i.e in above example, since "con rome" exist in one of the line, I need to print "urs". Please let me know how to do it using awk or sed commands. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|