Awk error for joining records with CR/newline

Is there any way to remove carriage retuns between the records?

These carriage returns are created in an excel cell by using Alt+enter, this is similar to new line...

We have input records separated by TABS and have carriage returns as below:

123 456 789 ABC "1952.00" 678 "abcdef
ghik
lmno"

Above we have 7 fields, notice that the 7th field in the records has carriage returns and make it into records...

I need to remove the carriage returns and make it look like below:

123 456 789 ABC "1952.00" 678 "abcdef ghik lmno"

I was given the below answer in the forum...

and this works for smaller record, this code gives an awk error "more than 199 fields"....

Code: filename JoinRecord.awk
{ record = record $0
# If number of quotes is odd, continue reading record.
if ( gsub( /"/, "&", record ) % 2 )
{ record = record " "
next
}
}
{ print record
record = ""
}

The above script works fine for small record. I recently got awk error something like more than 199 fields... I'm currently using awk -f JoinRecord.awk inputfilename > outputfilename on HP-UX 11.0 box...

we also don't have nawk on HP-UX 11.0.

Is there any way to overcome the above awk error?

Thanks in advance.

AC

You could try converting the awk to perl using a2p

Thanks a lot! It works great...

Can you please send me the sample code that worked for u.
extracting 200th field

I'm not extracting the 200th field here.

By the the original code is in the above posting. Only thing I did was to convert the awk to perl script as suggeted by Ygor. And that works great!