InDesign’s Data Merge feature is great. This is a video I return to, when I need to use it.
There is a catch, though: the data must be in the right format for this to work with Swedish text, which has å, ä and ö.
- Use a spreadsheet app to make a dataset (columns and rows)
- Use column names without spaces, and only lower-case characters. Do not use any “special characters”. So: only between a-z.
- Export it to CSV format
- Open the Terminal app in your Mac
- Change to your directory where the file is by dragging its folder into the Terminal window and hit ENTER. Perhaps you need the command cd followed by a space and then drag the folder. (Tip from commenter Dima. Thanks!)
- Type the following text command and press ENTER to change the file
filen.csv
to the target format (which is called utf-16):
iconv -f utf-8 -t utf-16 < filen.csv > filen2.csv
- A new file
filen2.csv
is created in the same directory. - Use this new file in your InDesign data merge!
Nerd notes:
- Typing
man iconv
will bring up a text manual for the iconv command. Try it! (Quit the manual by typingq
.) - the
<
and>
are “output redirection” symbols, used in two directions in this so-called pipeline
The manual taught us that the command can be expressed as:
iconv --from-code utf-8 --to-code utf-16 < filen.csv > filen2.csv
This may be easier to read.
- Changing directory can be done using the text command
cd
(“change directory”), followed by the path you want to navigate to. pwd
is a text command that reads “print working directory”. Try it!
My Terminal skills sucks. I got an error. But I did manage to open it in Text Wrangler and save it out as utf-16. Worked like a charm!
Glad you could use it!
A good editor is a great friend.
Thank you for the hint regarding file encoding for InDesign’s data merge feature!
I have struggled with files I created using UTF-8 encoding, now I see that UTF-16 does the right job.
You are a hero for documenting this.. Thank you!
I was struggling with this issue for years. Thanks for writing this up!
Hi,
I am struggling with french text that also has accented characters.
Point 2 in your guidelines : “Use column names without spaces, and only lower-case characters. Do not use any “special characters”. So: only between a-z.”
The problem is : InDesign recognizes as image paths columns preceded with “@” (e.g. “@myimagepath), but encoding the file in utf-16 results in a wierd column name inside InDesign that cannot be affected to an image field :-(
By chance, do you know how to fix this issue ?
Regards,
matt.
Great guide! Using it for Czech characters.
You might have forgotten to add “cd” for change directory in step 5 prior to dragging the folder into terminal.
You are right! I probably used zsh or some fancy integration. Thanks for adding that!