![]() |
|
|
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 |
| Script required to get a required info from file. Pls. help me. | ntgobinath | Shell Programming and Scripting | 2 | 05-31-2008 09:34 AM |
| xen help required | learnbash | Red Hat | 0 | 05-03-2008 10:46 AM |
| help required with cut -d | Amardeep | Shell Programming and Scripting | 4 | 11-27-2006 07:39 AM |
| Help required on DBX | Sumanth | SUN Solaris | 1 | 07-29-2004 10:54 AM |
| help required | ruffenator | High Level Programming | 1 | 02-03-2003 11:14 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hello guys I am new to awk programming. I need the below required script which can perform the following.
I have a file containing below data. SNA NoCRD = 131 SNA OBarr = 3 SNC NoCRD = 76 SNC OBarr = 1 SND NoCRD = 155 SND OBarr = 5 SNE NoCRD = 100 SNE OBarr = 1 SNF NoCRD = 131 SNF OBarr = 5 SNG NoCRD = 123 SNG OBarr = 2 SNH NoCRD = 129 SNI NoCRD = 121 SNI OBarr = 3 SNJ NoCRD = 124 SNJ OBarr = 4 SNK NoCRD = 118 SNK OBarr = 3 SNM UnK = 5 SNM NoCRD = 391 SNM OBarr = 3 SNN NoCRD = 101 SNN OBarr = 7. I want to replace the codes with a number but with a format like, If it is SNA then just print only a digit like 1. since in my case I have SNA for 2 times with two more values, so I want to print only a one line above those 2 values but not with SNA infront of each line. similarly i want to do for the rest of the file. and then dump it in a new file. Kindly help me in this regards. I will be very grateful. Thanks in Advance |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|