How to Strip lines off Streamed EDI Output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to Strip lines off Streamed EDI Output
# 8  
Old 11-19-2008
Code:
stdout | \                #pipe the output to awk, one line only
awk -F'~' '{              #set the field separator to ~
for(i=1;i<NF;i++)         #for each field except the last one(you don't have one anyway)
  { 
   if($i !~ /^[ISA|GS]/)  #if field Don't start with ISA or GS
      printf $i FS        #print(f) in the same line the field plus the field separator(~)
   }
}'

just copy/paste and try.

Last edited by danmero; 11-19-2008 at 12:19 PM.. Reason: typo
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

EDI File Parser

I've one EDI file which is to be parsed into 7 different file. I managed to extract required segments for a file(HEADER) to a separate file(sample3.dat) and is given below. $ cat sample3.dat REF*EI*273543997~ REF*2U*HELLO~ REF*G2*77685|132~ CLM*1000*0.00***12>B>1*N*A*Y*I~ CN1*05~... (5 Replies)
Discussion started by: ashokv3
5 Replies

2. UNIX for Dummies Questions & Answers

Strip out number from wc output?

I am trying to output two command substitutions echo "$(command) $(command)" with a single echo however when using wc -l within the second substitution, that substitution, instead of appearing in order at the end of the line output, it overwrites the beginning of the output line. I've tried... (2 Replies)
Discussion started by: somegeek
2 Replies

3. SCO

Add memory and EDI hard disk space

Dear all I would like to know if you have face to the problems as add 1. 256 MB DDR Ram memory 2. IDE 40 GB slaved hard-disk my current machine is GA-SIML Rev 1.0, 1.6 GHz CPU, 1GB HDD, 256 MB DDR-Ram memory, as I add another 256 DDR-Ram, and 40 GB Slaved EDI Hard disk it, the systems... (1 Reply)
Discussion started by: TinhNhi
1 Replies

4. Shell Programming and Scripting

parsing issue with edi file

Hello, We have edi files we need to do some extra parsing on. There is a line that shows up that looks like this: GE|8,845|000000000 We need to parse the file, find the line ( that begins with GE "^GE" ), and remove the comma(s). What is the easiest way to do that ? I know I can grab... (5 Replies)
Discussion started by: fwellers
5 Replies

5. Shell Programming and Scripting

KSH Output/Strip portion of file in HP-UX

I have a file, we'll call it file.txt. It has thousands of lines of all kinds of output at any given time (ie. foo bar foo bar) I need to copy out just a portion of the file from Point-A to Point-B. I'd like to save off just that portion to a file called test123xyz.txt. How do I do that? ... (7 Replies)
Discussion started by: austin881
7 Replies

6. Shell Programming and Scripting

Strip one line from 2 blank lines in a file

Hi Is there any command to scan thru a file looking for 2 consecutive blank lines and if any remove one of them. Please let me know. Regards, Tipsy (6 Replies)
Discussion started by: tipsy
6 Replies

7. Shell Programming and Scripting

strip first 4 and last 2 lines from a file using perl

Hi I have a file from which i need to remove the first 4 and the last 2 lines.. i know how to do it with sed but i need to do it in a perl script.. can you please help me how to do that. Thanks (10 Replies)
Discussion started by: meghana
10 Replies

8. Shell Programming and Scripting

How do you buffer streamed lines?

If I am running a cat|awk|sed on a file to get a bunch of numbers between 1 and 500 billion, how can I stay in stream, and still compare "this value" with "the previous value"? Really I could do this all in Perl, but if I can get it to work in-stream, its gonna be TONS faster... even if I can... (14 Replies)
Discussion started by: jjinno
14 Replies

9. Shell Programming and Scripting

Strip 3 header lines and 4 trailer lines

Hello friends, I want to remove 3 header lines and 4 trailer lines, I am using following , is it correct ? sed '1,3d';'4,$ d' filename (9 Replies)
Discussion started by: ganesh123
9 Replies
Login or Register to Ask a Question
oggz-rip(1)						      General Commands Manual						       oggz-rip(1)

NAME
oggz-rip -- Extract one or more logical bitstreams from an Ogg file. SYNOPSIS
oggz-rip [-o filename | --output filename ] filename oggz-rip [-h | --help ] [-v | --version ] Description oggz-rip extracts one or more tracks from an Ogg file. In Ogg terminology, oggz-rip extracts one or more logical bitstreams. For example, to extract just the Vorbis audio track from any Ogg file: oggz-rip -c vorbis input.ogx > output.ogg This will removed any other tracks: Skeleton, Theora, image, etc. The output will be a valid Ogg Vorbis I file, suitable for use on hard- ware players that do not support multiplexed (ie. multi-track) Ogg files. If the input file contains multiple Vorbis, the desired once can be specified by serialno with the -s option. Use oggz-info to view the serialno of each track in a file. Options oggz-rip accepts the following options: Miscellaneous options -o filename, --output filename Write output to the specified filename instead of printing it to standard output. -h, --help Display usage information and exit. -v, --version Output version information and exit. Filter options These options can be used multiple times. Pages matching ANY of the filter options will be included into the output. -s serialno, --serialno serialno Output streams with given serialno. -i index, --stream-index index Filter by stream index. These are assigned to streams in the order of their BOS pages, starting at 0. -c content-type --content-type content-type Filter by content-type. Run oggz-known-codecs(1) for a full list of codecs known by the installed version of oggz. EXAMPLES
Extract all bitstreams from file.ogg: oggz rip -o output.ogg file.ogg Extract only the Theora bitstream from file.ogv: oggz rip -c theora -o output.ogv file.ogv AUTHOR
David Kuehling January 1, 2005; COPYRIGHT
Copyright (C) 2005 CSIRO Australia SEE ALSO
oggz-merge(1), oggz-chop(1), oggz-dump(1), oggz-diff(1) hogg(1) oggz-rip(1)