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


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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.