Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to batch export different columns to different csv files in excel on an OSX, I'm thinking something along the lines of possibly automator, applescript or bash. I've had a look play around with automator and so far no luck.

The best I have accomplished export the whole sheet, then use sed to strip out what I don't need, however this is terribly inefficient.

Also, is there a method, to batch import multiple csv files into columns.

Thanks in advance

&& sorry I didn't tag excel correctly it wouldn't allow me to create the excel:mac tag

share|improve this question
up vote 1 down vote accepted

Export the whole sheet to CSV and use AWK to split it into different files. As a simple example, this awk script will write each column into a different file.

#!/usr/bin/awk -f
{ 
    for (i=1; i<=NF; i++)
        print $i >> "file" i ".csv";
}

This script is not too intelligent. You should also specify the field separator at the beginning, and also make sure existing files are overwritten.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .