Convert character encoding of a CSV file for InDesign Data Merge

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 ö.

  1. Use a spreadsheet app to make a dataset (columns and rows)
  2. Use column names without spaces, and only lower-case characters. Do not use any “special characters”. So: only between a-z.
  3. Export it to CSV format
  4. Open the Terminal app in your Mac
  5. Change to your directory where the file is by dragging its folder into the Terminal window and hit ENTER.
  6. 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
  7. A new file filen2.csv is created in the same directory.
  8. 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 typing q.)
  • 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!

Ruby: Rubocop-friendly Hash pretty-printer

You’re desperate. Your legacy code-generation code outputs a Hash using hash#to_s. You’ve flouted many Rubocop rules to get to where you are. Suddenly, it gets too much. You search the Web for a pretty-print function that you want: a Rubocop-friendly Hash pretty-printer.

Empty-handed, you cough up blood, while a police car’s red-blue lights flicker in through the blinds of your run-down office.

sethw-cop-car-lights

With tired fingers, you type out something like:

Then, you faint, blessed sleep converges on you and envelopes you in a colorless void.

Photo credit: sethw

Finished 2666

I finished reading a novel. Been a long slog. Five years to read a novel? Some blogger said they immediately began re-reading it, to see and experience the rich intertextuality etc. Thanks, Evan, for the reminder that it’s been so long. PS: the book was grand.

Sleep was overrated, the welcoming amazing

Thanks Nukomeet, for a chatty pre-conference event!

Thanks Alexander, Lukasz, Agnieska, Alban, Zaiste, Arsenia, Marcin, Johanna. And Robert and Christoffer. You are awesome, welcoming and interesting.

(Quickly ordering rhubarb desserts just before the kitchen closed – top of my good-life game. The place with the kitchen open was Nifty No 20.)

Selfies: Faces beat ideas

People may scoff, but the facts are: strangers and friends will interact with self-portraits. Is it the eyes? The gaze that meets yours?

I include here the one Twitter post that made others interact with me. I’ve published more than 7000 items. This one got attention and praise.

It’s time to get much more shallow.

In other news: progressivelarp.com.

UNIX aliases for fun, pt 1

Quoth @chastell:

alias computer,='sudo'
computer, apt-get install postgresql

PS: Alas, the oEmbed content from Twitter did not contain the image with the pun. Reproduced here. @chastell will forgive me.

As a bonus, do read these fine lines of Markdown-formatted talk summaries from a recent tech conference on Web technologies. Update: That page of notes is updated right now, and I reload it when I get to the end, because Karl Horky, the kind soul, has written more onto it.

Linz, that’s where the conference is. I’ve never been to Austria.