need help on manipulating a file
Hi,
I need a shell/command to achieve this task.
I've a delimited unloaded file from oracle in a scrambled format as shown below with many blank lines in it, I'm just trying to tailor it in a format that would be compatible to view and load it to a IDS db.
Here is the problem
Infile-
asd,sdfgsdf,,
<blank line 1>
fgsdfg, , , ,asfa,
<blank line 2>
<blank line 3>
sdfd,sdfd, ,
asd,asdd,
asdf, , , ,dsfd,
afdd,dsd
blank line 1 - potential data
blank line 2 - potential data
blank line 3 - record seperator
In the above ex, blank line1,2 is not a record seperator but it has a NULL data which is identified in the ASCII format. I'm trying to make the file into each data record in a single row as below, replacing the non-viewable data fields into some string (*$& here)
Output-
asd,sdfgsdf,, *$&,*$& ,fgsdfg, , , ,asfa, *$&
sdfd,sdfd, ,asd,asdd,asdf, , , ,dsfd,afdd,dsd
Please note that each blank line can have one or more fields in it
Thanks