SQL Server Import had troubles to import csv file, when some fields contained CRLF(\r\n).
Row delimiter needs to be changed.
Notepad++ was used.
It matches 15 columns (14 comma delimiters). CRLF is end of line. Some text columns contain CRLF(\r\n).
((?:(?:"(?:(?:""|[^"])+)"|(?:[^,]*)),){14}.*?)\r\n
to add a pipe as row delimiter replace with \1|\r\n
it matches $$ delimiter 7 fields (6 delimiters) and end of line \r MAKE sure . dot matches end of LINE!
(?:.*?\$\$){6}.*?\r
((?:.*?\$\$){13}.*?)\r\n to add a pipe as row delimiter replace with \1|\r\n
to search for $$ with grep (Linux or Cygwin), use single quotes and escape last dollar
grep -e '$\$' filename.csv
Row delimiter needs to be changed.
Notepad++ was used.
It matches 15 columns (14 comma delimiters). CRLF is end of line. Some text columns contain CRLF(\r\n).
((?:(?:"(?:(?:""|[^"])+)"|(?:[^,]*)),){14}.*?)\r\n
to add a pipe as row delimiter replace with \1|\r\n
it matches $$ delimiter 7 fields (6 delimiters) and end of line \r MAKE sure . dot matches end of LINE!
(?:.*?\$\$){6}.*?\r
((?:.*?\$\$){13}.*?)\r\n to add a pipe as row delimiter replace with \1|\r\n
to search for $$ with grep (Linux or Cygwin), use single quotes and escape last dollar
grep -e '$\$' filename.csv