How do you escape commas in CSV?

I have a CSV with commas in one column, so as in a CSV, I wrap that value with quotes:

Value 1
"Values 2, 3"
Value 4
Value 5
  • If I don’t do so, Lightburn throws this error: “The CSV file had an error on line 11” (is says 11 always, no matter the line where the comma is).
  • If I wrap the values with commas, it inserts the rest of the lines in the same placeholder (%0)
  • If I wrap all values (whether it has commas or not), it places all values in the first placeholder.

How do you insert values with commas as variable text?

I’m not sure if I’ve understood what you’re asking. But if you expect all these to come in as different columns you need to separate the values themselves by commas.

Value 1, "Values 2, 3", Value 4, Value 5

When you set your variable text as:

%0 %1 %2 %3 %4

It should show as:

Value 1 Values 2, 3 Value 4 Value 5
1 Like

I apologize for not explaining myself well. I have a list of names, and each time I fill the laser bed with 8 figures with 1 engraved name in each figure. After this, I engrave another 8 names, an so on.
I need to have the names in one column because there is an indeterminate number of names, and this way I can also use the “Current” and “Advance by” features in the Variable Text tab.

Okay. Thanks for the explanation of the setup.

I still don’t get the complication.

What does this mean? I can’t correlate the screenshot to the statement. What’s the actual problem?

Maybe i’m missing something.

I have this design:

That I feed with this CSV:

"Surname, Name 1"
"Surname, Name 2"
"Surname, Name 3"
"Surname, Name 4"
"Surname, Name 5"
"Surname, Name 6"
"Surname, Name 7"
"Surname, Name 8"

And I want this:

But I get this:

If the column doesn’t have commas and I don’t wrap the values with quotes, it works fine:

Surname Name 1
Surname Name 2
Surname Name 3
Surname Name 4
Surname Name 5
Surname Name 6
Surname Name 7
Surname Name 8

Ah, got it. Thanks for the explanation. Try this:

last1"," first1
last2"," first2
last3"," first3
last4"," first4
last5"," first5
last6"," first8
1 Like

This works fine, thank you!!!

I encourage the developers of this amazing application to support CSV files as defined in RFC 4180, section 2.5-7:

  1. Each field may or may not be enclosed in double quotes (however
    some programs, such as Microsoft Excel, do not use double quotes
    at all). If fields are not enclosed with double quotes, then
    double quotes may not appear inside the fields. For example:
    “aaa”,“bbb”,“ccc” CRLF

  2. Fields containing line breaks (CRLF), double quotes, and commas
    should be enclosed in double-quotes. For example:
    “aaa”,“b CRLF
    bb”,“ccc” CRLF

  3. If double-quotes are used to enclose fields, then a double-quote
    appearing inside a field must be escaped by preceding it with
    another double quote. For example:

Currently, LightBurn provides the following support. Variable Text Formats - LightBurn Software Documentation

Any sequence of characters enclosed in single quotes will be included verbatim in the output string (stripped of the quotes), even if it contains formatting characters. Two consecutive single quotes (’’) are replaced by a single quote in the output. All other characters in the input string are included verbatim in the output string.

1 Like

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