![]() |
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 |
| 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 |
| Changing one column of delimited file column to fixed width column | manneni prakash | Shell Programming and Scripting | 5 | 06-22-2009 06:27 AM |
| want to grep only strings in a file? | balan_mca | Shell Programming and Scripting | 5 | 11-03-2008 06:19 AM |
| Efficient way to grep multiple strings | Moxy | Shell Programming and Scripting | 3 | 08-13-2008 07:33 PM |
| grep: outputting search strings | tapmas | Shell Programming and Scripting | 3 | 03-10-2008 04:58 AM |
| Using grep to find strings of certain lengths? | crabtruck | UNIX for Dummies Questions & Answers | 4 | 11-04-2003 06:25 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Grep strings from file and put in Column
Dear Experts,
My file contains below- GET:SUB:ISI,432350414557432; RESP:0:MD,019352020633:ISI,432350414557432:T11,1:T21,1:T22,1:B16,1:T62,1:BAIC,0:BAOC,1:BOIC,0:BIRO,0 :BORO,0:PAID,1; GET:SUB:ISI,432350414581060; RESP:0:MD,019352020743:ISI,432350414581060:T11,1:T21,1:T22,1:B16,1:T62,1:BAIC,0:BAOC,0:BOIC,0:BIRO,0 :BORO,0:PAID,0; GET:SUB:ISI,432350211029016; RESP:11000003; GET:SUB:ISI,432350414073552; RESP:0:MD,019352032067:ISI,432350414073552:T11,1:T21,1:T22,1:B16,1:T62,1:BAIC,0:BAOC,0:BOIC,0:BIRO,0 :BORO,0:PAID,1; I want make a script like below- if find- RESP:0:MD,019352020633:ISI,432350414557432:T11,1:T21,1:T22,1:B16,1:T62,1:BAIC,0:BAOC,1:BOIC,0:BIRO,0 :BORO,0:PAID,1; then PAID,1 printf "paid" else PAID,0 printf "non-paid" if find- RESP:11000003 then RESP:11000003 printf "not-exist" So, after run the script output will be for the above file- paid non-paid not exits paid //purple |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|