What the extractor parses, and how
The whole text is parsed as delimited records, split on the delimiter you choose: comma, tab, semicolon, pipe or space. The parser follows the quoting convention of RFC 4180: a field wrapped in double quotes may contain the delimiter or a line break, and a doubled quote inside it ("") means one literal quote. Then it takes the columns you listed, counted from 1 (single numbers or ranges such as 2-4), and joins them with the output delimiter. Empty rows are dropped and the order you type is the order you get, so 3,1 swaps two columns.
Worked example
Input with "First row is a header" ticked, columns 1,3, joined with a comma:
name,email,city
Ada Lovelace,[email protected],London
"Smith, John",[email protected],"New York"
Grace Hopper,[email protected]
The header is removed from the output and listed above it as 1=name · 2=email · 3=city. The output is:
Ada Lovelace,London
"Smith, John",New York
Grace Hopper,
Notice the last row: it has only two cells, so column 3 is blank rather than an error. Notice also the second row: the value Smith, John contains the output delimiter, so it is written back with its quotes and stays one value.
Pitfalls and limits
- Quotes are added only when needed. A value is quoted on output if it contains the output delimiter, a double quote or a line break. Other values are written plain, so the result is not byte-for-byte identical to the input quoting. If you will paste the result somewhere that does not understand quotes, pick a delimiter that never occurs in your data, such as a pipe.
- Quoted line breaks work. A cell that spans two lines stays in one row. A quote only starts a quoted cell at the start of a cell, so a quote in the middle of a value, such as 55" screen, is literal. A quoted cell that is never closed shows an error asking you to check the quotes.
- Ranges are supported.
2-4means columns 2, 3 and 4, and4-2gives them in reverse. Anything that is not a positive whole number or a range shows a message asking for valid column numbers. - Out-of-range columns come back empty instead of raising an error, which is handy for ragged rows and easy to miss when you mistype a number.
- Spaces are not trimmed. The Space delimiter splits at every single space, so double spaces create empty cells. Cells keep any padding around commas.
- Semicolons. Spreadsheet programs in many regions export CSV with semicolons because the comma is the decimal mark there. If everything lands in column 1, change the input delimiter.
Typical next steps are removing repeated values with Remove Duplicate Lines, ordering them with Sort Lines, or quoting each value with Add Prefix and Suffix to Lines. If you need the whole file as structured data rather than one column, the CSV to JSON converter is the tool to reach for.