Csv file with escape character


(Rohit) #1

i have a csv file to index.
some records are split in multiple lines as one of the column contains double quotes as escape character.
eg:
lin1: 870525,abc,Inner User,Minor,2018-01-14 02:22:34,Management,Log in to the server,Network Management,Succeeded,User name: abc,2018-01-14 02:22:35
line2: 870526,abc,Inner User,Minor,2018-01-14 02:45:25,Management,Lock terminal,Network Management,Succeeded,"User name: abc
line:3 Terminal: 100.256.125",2018-01-14 02:45:25
line4:870527,abc,Inner User,Minor,10.119.136.175,2018-01-14 02:59:49,Management,Unlock terminal,Network Management,Succeeded,User name: abc
Terminal: 125.256,2018-01-14 02:59:49

line 2 and 3 corresponds to same records. and should be in the same line. Note: there is a double quotes as escape character in line 2.

can some one suggest a pattern to handle this ?

Thanks,
Rohit


(Magnus B├Ąck) #2

Doesn't the csv filter handle this out of the box?


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.