![]() |
|
|
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 |
| Extracting lines between 2 strings only if the pattern patches | simran | Shell Programming and Scripting | 5 | 04-23-2008 05:58 PM |
| Extracting data from text file based on configuration set in config file | suparnbector | Shell Programming and Scripting | 3 | 08-10-2007 03:25 AM |
| Extracting the lines between 2 strings of a file | babloo | Shell Programming and Scripting | 2 | 02-14-2007 11:27 AM |
| extracting lines from a file | pradeepthanraj | Shell Programming and Scripting | 1 | 11-15-2005 09:41 AM |
| Help required regarding Extracting lines from a file | google_ever | Shell Programming and Scripting | 1 | 10-12-2005 08:02 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
Quote:
under "substring extraction". then check with if/else statement |
|
||||
|
Hi TrichySelva,
Sorry for Late response(Actually I joined this forum today itself!!) To extract line number 5 and 7,use: bash-2.03# sed -n '5p;7p' cricketnews 5 and if Pakistan, as expected, beat Bangladesh the day after, 7 the virtue of having won more matches in the Super Four stage, Pakistan will go through. To Extract Say Line 4-6,12-15 and 32 to last,do this: bash-2.03# sed -n '4,6p;12,15p;32,$p' cricketnews 4 ousted from the event. If India lose to Sri Lanka on Thursday, 5 and if Pakistan, as expected, beat Bangladesh the day after, 6 both teams will be tied on four points. In that scenario, by 12 the CB Series in Australia. Therein lies the story: the CB 13 Series was played in Australia, the Asia Cup is being 14 played in Pakistan. And the Indian bowlers react differently 15 to the two types of conditions. 32 to struggle on pitches that give him zero assistance. 33 Dhoni thought the bowlers gave it their all, but 34 the pitch was just too unresponsive. To Extract say 25th to 30th(To extract 42nd char-just write 42) char and 34-38char of each of these lines, bash-2.03# sed -n '4,6p;12,15p;32,$p' cricketnews|cut -c25-30,34-38 eventf Ind , as ected, be tion fo in Auslia. yed instral stan. the es of ditio pitchthat the bors ga just tunres bash-2.03# sed -n '4,6p;12,15p;32,$p' cricketnews|cut -c42 l a p r i e i s Hope it solves ur purpose,though sadly bit too late I believe ![]() Sujan Banerjee |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|