CSV Import - Null field


#1

Importing a CSV file with 3 columns and a couple of hundred rows. Column headings and data types are correct. However, all data for first column is NULL.

Import example:

questionID,questionContentType,questionContent
1-11B4,Q,The Urgency signal concerning the safety of a ship aircraft or person shall be sent only on the authority of:
1-11B4,O,A. Master of ship.
1-11B4,O,B. Person responsible for mobile station.
1-11B4,O,C. Either Master of ship or person responsible for mobile station.
1-11B4,O,D. An FCC-licensed operator.
1-11B4,A,C
1-11B5,Q,The Urgency signal has lower priority than:
1-11B5,O,A. Ship-to-ship routine calls.
1-11B5,O,B. Distress.
1-11B5,O,C. Safety.
1-11B5,O,D. Security.
1-11B5,A,B

realm screen shot:

What am I missing here?

Any assistance appreciated,

John


#2

What am I missing here?

Data. You are missing data.
I’m sorry, I let myself out from here.


#3

Did you try to import via Realm Studio?
If you could please post a repro case to https://github.com/realm/realm-studio/issues/new/choose with the file you try to import, we can take a look.


#4

If you happen to find my Data in another post, please let me know. :cowboy_hat_face:

Thanks.
lol


#5

Hi:

Thank you for the quick response.

I am using Realm Studio. I played with the CSV file and eventually I was able to get it to work. I am not sure exactly why. I did a Command-A on the original content file in BBEdit, opened a new blank text document and then pasted it in there. The new file imports fine. I don’t see any difference in the files. Character count is the same as well.

I’m not going to question it. It works and I appreciate you offer for assistance.

Thank you,

JohnnyF


#6

Hi.

Figured this out for anyone else that runs into this issue with NULL for the first field in an imported CSV.

Found out that when the data was Saved As from an Excel Spreadsheet, they had picked the first CSV option in the list, “CSV UTF-8 (comma delimited)(.csv)”. What ever Excel is doing, is causing an issue when imported by Realm. What you want is to select “Comma Separated Values (.csv)” when you pick Save As from Excel. This format imports without an issue in Realm.

Hope this helps someone else down the line. It messed me up for a couple of days.

JohnnyF