![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help me for AWK URGENT | readycpbala | Shell Programming and Scripting | 2 | 02-22-2007 01:03 PM |
| URGENT,URGENT- Need help tape drive installation | sriny | UNIX for Advanced & Expert Users | 3 | 11-16-2006 03:43 PM |
| URGENT---URGENT--No OK PROMPt after RSC CONFIG | sriny | SUN Solaris | 7 | 10-29-2006 11:06 AM |
| Urgent !! | desiondarun | UNIX for Dummies Questions & Answers | 1 | 08-08-2006 09:49 AM |
| urgent 2 | hamoudzz | UNIX for Dummies Questions & Answers | 1 | 03-03-2004 09:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi Guys,
Need one quick help. I have one file test.sh #cat test.sh <Abc>200712241314</Abc> I need the output value in between <Abc> </Abc> mean to say "200712241314" I am using cut command for that. But my problem is that test.sh file not same format. Some time it will have some whitespace from start. Could you help me. I want the ouput value in between <Abc> </Abc> in anywhere that file. It is Urgent !! Thanks Sanjay |
|
||||
|
man sed - urgently!! I guess that you do not have multiple <Abc>..</Abc>-combinations on one line so that following line would be impossible: Code:
blabla <Abc> value1 </Abc> blabla <Abc> value2 </Abc> blabla If this *is* the case you should start reading the sed-manpage even more urgently, as it is going to be a little more elaborate than the simple case replace "<spc>" "<tab>" by literal blanks and tabs: Code:
sed 's/^.*<Abc> *\([^<spc><tab>][^<spc><tab>]*\) *<\/Abc>.*$/\1/' test.sh This removes the whitespace too. bakunin |
|
||||
|
Quote:
([^<spc><tab>][^<spc><tab>]*\) & ".*$/\1" . Thanks Bishweshwar |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|