Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-03-2006
hegemaro hegemaro is offline
Registered User
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
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\}\*'