The CSV file format is not fully standardized even there exist RFC4180
(this standard only specifies handling of text-based fields).
RFC4180 requirements:
- MS-DOS-style lines that end with (CR/LF) characters (optional for the
last line).
- An optional header record (there is no sure way to detect whether it
is present, so care is required when importing).
- Each record "should" contain the same number of comma-separated
fields.
- Any field may be quoted (with double quotes).
- Fields containing a line-break, double-quote, and/or commas should be
quoted. (If they are not, the file will likely be impossible to
process correctly).
- A (double) quote character in a field must be represented by two
(double) quote characters.
Back to your question:
I have a comma separated list of email addresses for example
[email protected], [email protected], [email protected]
But I would need to convert it to proper CSV format. So replacing the
spaces, I assume
To remove spaces:
- Press Ctrl+H.
- In the field
Find what
type [ \t]+
- The field
Replace with
should be empty.
- In the
Search mode
section switch radio button to regular expression
and hit button Replace All
When you cleared text from spaces, you may want to enclose column data in quotes:
- Press Ctrl+H.
- In the field
Find what
type ([^,\r\n]+)
- In the field
Replace with
type \"\1\"
- In the
Search mode
section switch radio button to regular expression
and hit button Replace All
Note: this (surrounding data in quotes) applies to the text saved in DOS/Windows format, if you processing data from Linux, then remove \r
form Find what
field.