Hi,
I have a file that contains a set of fields.
The fields are enclosed with quotes ("") and separated by a comma. The problem is that one of the fields is an address field that contains carriage return characters. AWK treats this as a new line.
Any ideas how to handle this. I have tried removing them using
and
but this has not worked.
Am I using the right approach but wrong syntax or how can I solve this. Or can AWK handle this. I am using the comma as the separator
Here is and example of the text
"first", "second" , "no prob" , "forth"
"first", "second" , "third addres
problem
", "forth field"
"first", "second" , "no prob" , "forth"
"first", "second" , "no prob" , "forth"
Any suggestions?
I have a file that contains a set of fields.
The fields are enclosed with quotes ("") and separated by a comma. The problem is that one of the fields is an address field that contains carriage return characters. AWK treats this as a new line.
Any ideas how to handle this. I have tried removing them using
Code:
gsub("\r", "")
Code:
gsub(/\r/, "")
but this has not worked.
Am I using the right approach but wrong syntax or how can I solve this. Or can AWK handle this. I am using the comma as the separator
Here is and example of the text
"first", "second" , "no prob" , "forth"
"first", "second" , "third addres
problem
", "forth field"
"first", "second" , "no prob" , "forth"
"first", "second" , "no prob" , "forth"
Any suggestions?