OO5 and import/export of Tab Separated Values

I have tried the OO5 trial and wondered if the following is possible or could be added.

  1. Opening a TSV file - the first row is not interpreted as the header. Could a checkbox be added to the open dialog (or preferences) to do this?

  2. Is it possible to paste tab separated rows from another document into OO5 and have the relevant values placed in each column rather than all just in the first column?

  3. From the help documentation it mentions that CSV files cannot be imported, only tab separated, but the export function does not include tab separated files, only CSV. It would be nice to see the missing formats added to both import & and export.

  4. Is it possible to copy the rows with the column headings (maybe a preference setting)? I noticed that multiple columns can be selected but OO5 just bleeps and ignores any copy command. It would be a nice feature to be able to copy out only selected columns.

Thanks

Hi,

All good points, there are a few workarounds that may help though.

  1. I have written a simple script that you can use to copy the first row to the column headers. I’ve not scripted OmniOutliner before so there may be a better or more correct way to do this but it works for me.

    tell application “OmniOutliner”
    – Use the first row to set the column headings
    tell front document
    repeat with colPos from 2 to count of every column
    – Use row 1 as source
    set the title of column index colPos to rich text of cell colPos of child 1 as text
    end repeat
    end tell
    end tell

  2. Yes, select the row before you paste and OO5 will create a row for every line and a column for every tab in the pasted text.

  3. The following Python script works when converting CSV data to TSV which would allow you to import CSV data after conversion

CSV to TSV python one-liner

I saved the csv2tsv.sh example to a file with that name and made it executable via the Terminal:

chmod a+x csv2tsv.sh

The shell script and source.csv file were on my desktop and the terminal’s path was set to the Desktop folder, the command then converted the file:

./csv2tsv.sh < source.csv > output.txt

I then opened the output.txt file in OO5. If your source.csv file contains the column headings then the script above will copy them into the column headings.

You can export to Excel in OO5, this may be a Pro feature, and export to TSV from either Excel or Numbers. It would be good to see both formats for export and import though.

  1. This would be a handy feature, currently the only way would be to export to CSV and edit in a spreadsheet.

Thanks for the great reply. Your tip for point 2 regarding copying tabbed data into columns is really helpful.
The applescript also works great. I noticed that to get it to work on an v3 of OmniOutliner, “rich text” needs to be replace with “value”.

I realised after posting the question that tabs can be a bit problematic for export since it is OK for a single level of data, but indented sub-rows also use tabs. Hence it would only be useful for the import / export of plain tabular data.

It would still be nice to see CSV import supported along side tab-separated files, and point 4, copying selected columns.

I don’t know if there is any help for me on this – is there an apple script to do this function. I am new to scripting for omni but have used the products since inception.

Hi Jezeba,

Welcome to the OmniFora.

Which function is it that you’re interested in. There were at least four mentioned above.