I have a data file such containing text such as below:
FIELD1~FIELD2~"FIELD3"~FIELD4-"$$$$"
FIELD1~FIELD2~"FIELD3"~FIELD4-"$$$$"
FIELD1~FIELD2~"FIELD3"~FIELD4-"$$$$"
FI
ELD1~FIELD2~"FIELD3"~FIELD4~"$$$$"
Some of the records are broken so I need to first remove all newline characters. Once this has been fixed, the characters ~"$$$$" will denote when my record line (will end) so I will need to replace all occurrences of ~"$$$$" with a newline character. My only problem is that I am not familiar with handling the newline character \n in sed or awk. Any suggestions?
FIELD1~FIELD2~"FIELD3"~FIELD4-"$$$$"
FIELD1~FIELD2~"FIELD3"~FIELD4-"$$$$"
FIELD1~FIELD2~"FIELD3"~FIELD4-"$$$$"
FI
ELD1~FIELD2~"FIELD3"~FIELD4~"$$$$"
Some of the records are broken so I need to first remove all newline characters. Once this has been fixed, the characters ~"$$$$" will denote when my record line (will end) so I will need to replace all occurrences of ~"$$$$" with a newline character. My only problem is that I am not familiar with handling the newline character \n in sed or awk. Any suggestions?