Apr 27, 2004 #1 ranjit Technical User Apr 14, 2000 131 GB What is the best way to awk out the line of text between <> Input file: DataLine756<TRANS:6707,Bank of America,INV.7868467>#L$T Desired output: TRANS:6707,Bank of America,INV.7868467
What is the best way to awk out the line of text between <> Input file: DataLine756<TRANS:6707,Bank of America,INV.7868467>#L$T Desired output: TRANS:6707,Bank of America,INV.7868467
Apr 27, 2004 #2 CaKiwi Programmer Apr 8, 2001 1,294 US Try { sub(/^[^<]*</,"") sub(/>.*$/,"") print } CaKiwi Upvote 0 Downvote
Apr 27, 2004 #3 vgersh99 Programmer Jul 27, 2000 2,146 US Code: BEGIN { FS="(<)|(>)" } { for (i=0; i<=NF; i=i+2) print $i } vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
Code: BEGIN { FS="(<)|(>)" } { for (i=0; i<=NF; i=i+2) print $i } vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Apr 27, 2004 #4 fjchia Technical User Feb 8, 2004 7 US Or try awk -F"[<>]" '{ print $2 }' Upvote 0 Downvote
Apr 27, 2004 #5 vgersh99 Programmer Jul 27, 2000 2,146 US don't forget [bold]multiples[/b] vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
don't forget [bold]multiples[/b] vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Apr 27, 2004 #6 PHV MIS Nov 8, 2002 53,708 FR And the sed way: sed -e 's!.*<!!;s!>.*!!' /path/to/input >output Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 Upvote 0 Downvote
And the sed way: sed -e 's!.*<!!;s!>.*!!' /path/to/input >output Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884