Hi,
I am facing one interesting problem :
I have a file which contains data like this
459,|1998-11-047|a |b |c \n efg | d|e | \n
459,|1998-11-047|a \n c|b |c \n efg | d|e | \n
Basically what I have to do is , I have to remove all \n which is coming ( enclosed ) in between two pipes ( | ).. The red coloured only...
The problem I am facing is , when i try to do it using sed .. because of this \n , sed takes the entries after it as next record.
Thanks a loooooot!!!!!
My problem have been solved....
The Solution Suggested by Unbeliever is working fine....
When I tried with the solution by jerardfjay , it gives me the following error : Segmentation fault(coredump) .. Could you please tell me why ? I am using AIX 5.
The solution with sed by reborg is also working fine.. but it fails , if more that one \n is there in a single line. It appends the first with second..and so on... any way could you please explain the code.. if you don't mind
I am facing the same problem as shihabvk just that my row does not end with any particular character and my delimiter of the file is #~# as this in one combination of unique character in the file that does not matches the column data.
For eg.
asds #~#sdsdf#~#fsadf#~#sfad \n sdf \n sdsf \#asdnf \n
sdfdf#~#sadfs#~#sfwe#~#sdfsdf \n sdf s sdf \n#~# \n
and i want it in this format
asds#~#sdsdf#~#fsadf#~#sfad sdsf \#asdnf \n
sdfdf#~#sadfs#~#sfwe#~#sdfsdf sdf s sdf \n#~# \n
This requirement is only for the 4th column. Please help in out with this.