Error Importing Customer CSV file - Unquoted fields do not allow \r or \n (line 2).

Topic summary

Users encounter a CSV import error in Shopify: “Unquoted fields do not allow \r or \n.” This typically occurs when CSV files contain blank lines between the header row and data rows, or embedded newline characters within fields.

Root Cause:

  • Blank lines in the CSV file (most common)
  • Whitespace or hidden characters
  • Incorrect line ending encoding (\r vs \n)

Solution:

  • Remove all blank lines from the CSV file
  • Ensure no empty rows exist between header and data
  • Delete unwanted lines by selecting them (Shift+click), right-clicking, and choosing ‘delete lines’

Status: Multiple users confirmed the fix works after removing blank lines. The discussion remains active with users requesting help to clean their specific CSV files, though some are seeking direct file corrections rather than learning the fix themselves.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hi,

I have generated this CSV file with only 1 item for now. I am getting error when importing. Any one who can point out the issue? Also Do I need to have these many columns. I don’t need columns like Published Option1Name etc Thanks!

Unquoted fields do not allow \r or \n (line 2).

Below is file contents ..Fields and then 1 st row.

Handle,Title,Body (HTML),Vendor,Type,Tags,Published,Option1 Name,Option1 Value,Option2 Name,Option2 Value,Option3 Name,Option3 Value,Variant SKU,Variant Grams,Variant Inventory Tracker,Variant Inventory Qty,Variant Inventory Policy,Variant Fulfillment Service,Variant Price,Variant Compare At Price,Variant Requires Shipping,Variant Taxable,Variant Barcode,Image Src,Image Alt Text,Cost per item

PB1272,SEAHORSEWHTL6.5BON,SEAHORSEWHTL6.5BONESTAG,MyVendor,KNIVESACCESSORIES,N,PB1272,2048.00,0,deny,manual,63.7200,60,Y,Y,121205035727,43.3500

Hey there,

Most probably there is a new line at the end of the file or a whitespace character in the second line or maybe the encoding is to blame? If you can share the actual file you are trying to upload that would help.

Thanks for your reply. I am attaching the actual file.

Yup, you have three lines, the second line is blank. There should be no blank lines in a CSV file. You don’t have to separate the header (fields) and the values (all subsequent lines). I’ve removed the line and reattached.

2 Likes

That worked!! I am bit amused as to how does the import proces differentiate when one product ends and next starts.

Thank you for your help ! I appreciate it.

I;m having the same problem while uploading csv file. It says Unquoted fields do not allow new line <“\r”> in line 1.

1 Like

Can anyone help me with this error?
kindly find the attachment and tell me where I did a mistake
Thanks.

@Rubaha please attach the original CSV file you are trying to upload.

Thanks, I was having this issue, there can’t be any blank lines in the csv file for shopify to upload them.

Can you explain how to remove unwanted lines or characters. I am having this same issue. I would like to know how to correct it for future refernece. Thank you

Select the blank lines by clicking each one while holding Shift, then let go of the Shift key and right-click on one of the highlighted blank lines once all of them are selected, then click ‘delete lines’.

This new CSV file should work.

I have the same issue with this file. can you please help me with that? that would be awesome. Thank you. i got the error: new line must be r not n in line 3. thank you so much!

Hi there,

I’m trying to import my product CSV file from another platform into Shopify, but I received an error:

“Unquoted fields do not allow \r or \n (line 1).”

Shopify support mentioned that the issue might be caused by blank spaces in line 1 or formatting issues. Unfortunately, my English is not very good and I’m not sure how to fix this file correctly.

I’ve attached the CSV file below. Could any Shopify partner or developer please help me clean it up and send the corrected version to my email? That would be a huge help!

Email: jamesvince6468@gmail.com

Thank you so much in advance!

Best regards,
James