i have malformed csv file has 2 columns: text,value
the value either 1 or 0, lines malformed , span 2 lines:
1. "this line fine, there not this",0 2. "another line",1 4. "oh, i'm bad!! 5. spanned 2 lines!",0 6. "why did break me? filehelpers can't read 2 lines!!",1
line 4 , 5 supposed 1 line, csv file got broken , span 2 lines, causes filehelpers engine fail while reading csv file.
i have 2 csv files 3000 lines each , need fix them once. want use notepad++ find lines not ending in ,0 or ,1, kind of regex can use that? or maybe regular expressions, 1 ,0 case other 1 ,1 case.
update:
dan's answer works without comma [^01]$ instead of ,[^01]$, matches lines not ending 0 or 1... works sufficiently in case, skip lines broken , end 0 or 1.
i don't know how other answer work:
something below use in notepad++
[^,][^01]$
here steps did:
use ([^,][^01])$
match lines , replaced \1{marked}
then switched extended mode , replaced {marked}\r\n
`` ( empty ) single line.
screenshots below:
Comments
Post a Comment