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