![]() |
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 |
| usage of module Text::Wrap; | trek | Shell Programming and Scripting | 3 | 06-05-2008 02:08 AM |
| word wrap issue with grep | bowtiextreme | HP-UX | 4 | 04-30-2008 07:39 PM |
| SCO acquisition wrap-up | iBot | UNIX and Linux RSS News | 0 | 02-19-2008 05:30 PM |
| Wrap Interactive Script | meskue | Shell Programming and Scripting | 0 | 06-23-2006 06:21 PM |
| word wrap in vi | dangral | UNIX for Dummies Questions & Answers | 3 | 10-30-2002 02:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
This is my first time post a new thread. I have been trying to work on this for the past 2 days and could not find any good solution. I have 1 long long line ( EDI wrapped file) like below: NEW*SR*04411763447*279*278*Q~*ZR*AAV*SR*04511763460*SQ*21B37F04~HL*305*304*Q~K~SN1*1*1*SR*0551176346 1* and so on...all in 1 long line. I need to extract certain pattern =grep 'SR\*[0-9]\{11\}\*' ( example SR*04411763447*) and remove others and put it to output file like: SR*04411763447* SR*04511763460* SR*05511763461* . . etc. I tried use grep and sed..but have no luck working on wrap file. Please help. Last edited by vanda_25; 05-03-2006 at 01:17 PM.. |
|
||||
|
I've been working with X12 documents for the last year and a half and finally wrote a C program to print out the segments one per line. However, a nice quick-and-dirty trick is to convert the segment terminator (usually, but not always, a tilde) to a newline.
# cat file | tr '~' '\n' | grep 'SR\*[0-9]\{11\}\*' |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|