Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two character record seperator

Status
Not open for further replies.

richardii

Programmer
Jan 8, 2001
104
GB
I have a text file that I want to process using RS =");"

Problem is that the file has ")" in as well, and awk is recognising ")" as the RS, as well as ");"

How can I get round this?

Thanks.
 
Only the 1st char of RS is significant. One solution may be to pipe the file through sed (or similar) first, and change the separator from ); to a single character of your choice.

Greg.
 
Hi Richardii-

Is this what you need?

If this does not work, please post a snippet of both
input and the desired output.


awk ' {

count = split($0,arr,");")

for (i=1;i<=count;i++) print arr

}' input > output

HTH



flogrr
flogr@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top