Need Help to delete carriage return and new line in csv file

Hi All,

I have a problem loading the data from a csv file
As you see below in the Input ,For the Data starting with " there are 2 lines, which i want to make them into single without changing the format of that data.
You can see the desired output below:
While i try to open the csv file and see the could see the whole text in a single column, but when i try to see in edit plus only i see that data after "Order raised to credit back overpayment against order 0981/1571Q." is going to next line and im not able to load the data .

Header for the file has some 13 columns, im getting this problem with 9th column in the file

Input :

12345|477.5|C|123/1234|12345678|1234|1234/1234567|Emergency Lighting|"Order raised to credit back overpayment against order1233/12345.
Hi Abcd
 Could you please arrange credit for the above as follows �123
 The wrong quote was uploaded against this job but the correct works have been carried out.  If you need paperwork to confirm let me know and I will forward it on to you 
 Many thanks
 Kind Regards,
Abcdedfg
Admin & Invoicing Team Member
12345 567898"|ABCDEFGH|16/12/2014|1234|ABCD1010

Desired Output :

12345|477.5|C|123/1234|12345678|1234|1234/1234567|Emergency  Lighting|"Order raised to credit back overpayment against  order1233/12345.Hi AbcdCould you please arrange credit for the above as follows �123The  wrong quote was uploaded against this job but the correct works have  been carried out.  If you need paperwork to confirm let me know and I  will forward it on to you Many thanks
 Kind Regards,AbcdedfgAdmin & Invoicing Team Member12345 567898"|ABCDEFGH|16/12/2014|1234|ABCD1010

I want the system consider the text starting " to the text ending with " as a single line.

Could anyone please help me out with the solution for this.

Regards,
Lavanya.

The number of lines in the sample do not correspond to the number mentioned in the description . Could you please correct this, to avoid confusion?

Please do so while keeping the CODE tags that were inserted in place.

Your data don't have carriage returns in them and, working on *nix, you should be grateful therefore.
For your problem, umpteen solutions have been discussed in these forums, an intense search might be worthwhile. For EXACTLY your problem and samples given above, try

awk '{while (!(NF%2)) {getline TMP; $0=$0 " " TMP}} 1' FS="\"" file

NO error checking is being done, and should you modify e.g. the data structure, it's highly probable to fail.

1 Like

Hi Scrutinizer,

The data which i have posted is actually a single row with 13 columns separated with pipe symbol(|)

I need the data with in double quotes to be considered as single column.
that is from Order raised to 12345 567898
As of now i see that line "Order raised to credit back overpayment against order1233/12345" is treated as 1 column and "Hi Abcd
Could you please arrange credit for the above as follows �123
The wrong quote was uploaded against this job but the correct works have been carried out. If you need paperwork to confirm let me know and I will forward it on to you
Many thanks
Kind Regards,
Abcdedfg
Admin & Invoicing Team Member
12345 567898Hi Abcd
Could you please arrange credit for the above as follows �123
The wrong quote was uploaded against this job but the correct works have been carried out. If you need paperwork to confirm let me know and I will forward it on to you
Many thanks
Kind Regards,
Abcdedfg
Admin & Invoicing Team Member
12345 567898"|ABCDEFGH|16/12/2014|1234|ABCD1010 is treated as next line

Input :
12345|477.5|C|123/1234|12345678|1234|1234/1234567|Emergency Lighting|"Order raised to credit back overpayment against order1233/12345. Hi Abcd Could you please arrange credit for the above as follows �123 The wrong quote was uploaded against this job but the correct works have been carried out. If you need paperwork to confirm let me know and I will forward it on to you Many thanks Kind Regards, Abcdedfg Admin & Invoicing Team Member 12345 567898"|ABCDEFGH|16/12/2014|1234|ABCD1010

Desired output:
12345|477.5|C|123/1234|12345678|1234|1234/1234567|Emergency Lighting|"Order raised to credit back overpayment against order1233/12345.Hi Abcd Could you please arrange credit for the above as follows �123 The wrong quote was uploaded against this job but the correct works have been carried out. If you need paperwork to confirm let me know and I will forward it on to you Many thanks Kind Regards, Abcdedfg Admin & Invoicing Team Member 12345 567898"|ABCDEFGH|16/12/2014|1234|ABCD1010

Please let me know if this is clear. Else please do let me know ..

Regards,
Lavanya.

---------- Post updated at 09:21 PM ---------- Previous update was at 09:19 PM ----------

Hi Rudic ,

Will try the same,

Thanks for your reply..

Regards,
Lavanya.

Hi Lavanya, no this is not clear. Please use code tags (<- click here) for code and data, so that the input and output samples have fixed width fonts and the proper number of lines and it is also clear what is sample and what is description...