Sample Header Ad - 728x90

Removing new line character from a column in a CSV file

2 votes
7 answers
5384 views
We are getting new line character in one the column of a CSV file. The data for the column is coming in consecutive rows. Eg:
ID,CODE,MESSAGE,DATE,TYPE,OPER,CO_ID
12202,INT_SYS_OCS_EX_INT-0000,"""OCSSystemException: HTTP transport error: java.net.ConnectException: Tried all: '1' addresses, but could not connect over HTTP to server: '10.244.166.9', port: '8080'
 failed reasons:
   address:'/10.244.166.9',port:'8080' : java.net.ConctException: Connection refused
""",06-09-2021 05:52:32,error,BillCycle,6eb8642aa4b
20840,,,06-09-2021 16:17:18,response,changeLimit,1010f9ea05ff
The issue is for column Messageand id 12202 , in which data is coming in triple quotes and in consecutive rows. My requirement is that for the column Message, the data should come in a single row rather than multiple rows, because my etl loader fails to import an embedded newline.
Asked by mansi bajaj (29 rep)
Sep 22, 2021, 11:47 AM
Last activity: Jun 24, 2025, 01:25 PM