Skip to main content
Inspiring
March 24, 2013
Question

Importing CSV file with Data Merge Fails

  • March 24, 2013
  • 7 replies
  • 47388 views

Specs

See pasted text from CSV at http://pastebin.com/mymhugpN

I am using InDesign CS6 (8.0.1)

I created the CSV by downloading it from a Google Spreadsheet as a CSV. I confirm with the Terminal that the character encoding is utf-8 usnig the file command.

Problem detailed

I am trying to import a CSV file (utf-8) with Data Merge via the Select Data Source... command with Show Import Options checked. When viewing the Data Source Import Options dialog, I set the following options—Delimiter:Comma, Encoding:Unicode, Platform:Macintosh. I leave Preserve Spaces in Data Source unchecked. It fails to import any variables and produces no error message. I have tried other CSV files as well (created TextEdit, Espresso, etc.) and it seems that InDesign will not import any files if Unicode is specified as the encoding, no matter which other options are specified.

Can anyone else confirm this?

Importing as ACSII works, but obviously does not display my content correctly.

This topic has been closed for replies.

7 replies

ajbarabasz
New Participant
January 18, 2019

InDesign cannot correctly read UTF8 files. This is not a minor inconvenience. It's a bug, let us call a spade a spade.

All you have to do is save file as UTF16 (big-endian or little-endian, with BOM or not - it doesn't matter). Simply don't use UTF8.

BobLevine
Community Expert
January 18, 2019

This has run its course. Locked!

New Participant
April 25, 2018

Hi,

Here is what has worked for me on MacOS High Sierra:

Open Sublime (I am using Sublime editor version 3)

Paste text

File > Save with encoding > UTF-16 LE

Hope this helps.

New Participant
September 21, 2016

Hi,

The easiest way that i have discover just, if you are merging data from excel to csv and your file supports unicode-8 or unicode-16 characcters dont try to save file in csv first save as file in unicode-16.txt format than rename it and change files extension in csv.

when you rename this file and open in texteditor or notepad it change the character, when you merge data in ID it shows correct data.

New Participant
October 7, 2015

When using data merge always ensure your targeted data base file is closed!!

Data merge will not work if the targeted file is open in the original program

nikcub
New Participant
May 19, 2015

It needs to be saved as UTF-16 with the BOM preserved.

For Mac, export as CSV and then open it in TextEdit, Sublime Text or a similar editor that can save in different encodings. In TextEdit you need to hold option while clicking File and then selecting Save As ... and then selecting Unicode (UTF-16) as the encoding

In Windows use Notepad or a similar editor.

New Participant
May 13, 2013

I've run into similar problems. I'm using OpenOffice to create a spreadsheet that I export to CSV, and use that as the data source for an InDesign CS2 document. When exporting from OO, if I use the default UTF-8 setting, and open the CSV file in TextWrangler, it shows as "UTF-8 with no BOM". If I resave it as UTF-8, it fails to import.

The thing is, I have some symbols in the Apple Symbols font that I need to import into my document. When the spreadsheet is exported as UTF-8, the file imports, but the symbols don't print correctly, but they show up correctly in Textwrangler. I found, through trial and error, that if I create the CSV file using the plain "Unicode" setting, then open it up in Textwrangler, it shows up as "Unicode UTF-16". I then import this data source into InDesign CS2, using the options "Unicode" and "PC", and it works perfectly.

I'm on Mac OS X 10.5.8 Intel.

maciejkukulka
New Participant
February 11, 2015

Yesterday I had the same problem on my Mac. Because of polish letters like: ą, ę, ś, ź, ż I needed to find a solution. I tried to import csv file into InDesign CC and importing as Unicode UTF-8 didn't work. Finally i tried OpenOffice with exporting csv file with classic Unicode with no extension and it works great with InDesign.

In my opinion this problem should be fixed by Adobe because it is more than a year when it exist. Or at least it should be described in Help.

Willi Adelberger
Community Expert
February 11, 2015

Try to use a tab stop separated txt file instead of a coma separated CSV file. When I work on the Mac in German I have the same problems with CSV, with TAB it works fine. I use always unicode UTF 16 as this supports Eastern European Characters like polish additional to or Western Languages like English or French.

Peter Spier
Community Expert
March 24, 2013

pattern86 wrote:

Importing as ACSII works, but obviously does not display my content correctly.

Obviously? What's obvious? What isn't being displayed correctly? I'm not sure that pastebin supports non-ascii characters, but I don't see anything in the paste in a quick look that should be a problem if the file is saved in ascii format.

If you want someone to test the file to see the results we'll need a link to a sample file.

jsejcksnAuthor
Inspiring
March 24, 2013

It can be any valid unicode CSV file. One column or seven columns, one row or fifty rows, just alphabetic letters or numbers or unicode-only characters... it doesn't matter. None of them will import if Unicode is selected in the Data Source Import Options dialog.

Use what's in the pastebin link or copy and paste this into a new text file and save it as a utf-8 CSV and test:

Variable 1,Variable 2,Variable 3

John,Kevin,yes

Marsha,Jan,no

Roger,Bridget,no

Stephanie,Larz,yes

(And pastebin does support unicode characters—there are several left- and right-double-quotes in my example.)

jsejcksnAuthor
Inspiring
March 25, 2013

I don't think so. I think it's a problem with UTF -8 encoding. Can you save as a different flavor of unicode from Google?


Google Drive only supports one format for exporting to CSV. I've tried converting the exported file to utf-8, utf-16—no dice. The best I can come up with is to import a unicode file as ASCII and then Find & Replace all out of range characters that were modified (sometimes lots of different characters, depending on the content).