Excel import / export

190 views
Skip to first unread message

alx

unread,
Feb 28, 2009, 3:58:51 PM2/28/09
to TreeSheets
Hi Wouter,

This topic was briefly mentioned in the Welcome thread, but I thought
I'd start a new one to have a more focused discussion.

I tried the CSV and tab delimited import from Excel. Tab delimited
worked fine, but CSV didn't. From the results, it seems to me that
TreeSheets expects a comma separated file, but excel uses semi colons
(;) by default.

Regarding export, which I think would be extremely useful (it makes to
me more sense to start developing a concept from TreeSheets and moving
in to Word and Excel for sharing with others) I'll hopefully be back
soon with a couple of ideas.

Cheers
Alexander

alx

unread,
Mar 1, 2009, 2:09:09 PM3/1/09
to TreeSheets
Hello again Wouter,

Here's my take on exporting to Excel :-) You will find a zip file in
your mailbox containing the test files mentioned here.

- Export as indented text is already a starting point. However, excel
does not recognise indented text, unless tabs are used for indenting.
So I started from an export of the Tutorial file to indented text
(tutorial1.txt) and then changed the indenting spaces to tabs with the
help of Brainstorm ( http://www.brainstormsw.com/ ). I had no trouble
reading the result into Excel; actually copy/pasting from a text
editor works fine. (The result is tutorial1.xls.)

- The main problem here is that grids with more than one columns are
flattened, which is not desirable in Excel. So:

Tequila 2
Gran Marnier 1
Lime juice 0.5

becomes

Tequila
2
Gran Marnier
1
Lime juice
0.5

If grids are exported as grids, with tab-delimited columns, it works
fine. I did this manually (tutorial2.txt) and the result is a much
better representation of the original TreeSheets subgrids. (See
Tutorial2.xls).

Hope it makes sense.
Cheers
Alexander

Wouter van Oortmerssen

unread,
Mar 2, 2009, 11:37:45 AM3/2/09
to trees...@googlegroups.com

That is most odd. I tested various files, and CSV (which means COMMA
seperated values) always comes out with commas, and imports perfectly.

What version of excel do you use (mine is 2007) ? are you sure its the
CSV format?

Supporting a semi-colon delimited version will take me all of 10 minutes,
but I want to make sure its necessary first :)

Wouter

Wouter van Oortmerssen

unread,
Mar 2, 2009, 12:11:42 PM3/2/09
to trees...@googlegroups.com

Alex,

Had a look at your files. I am not sure if the indented text is such a good
basis for importing into excel. Yes, it works, but I don't see how such
tree structures do anything useful, especially since excel doesn't
resize cells for you, so all contents ends up overwriting neighbouring cells.

Can you describe me a usage scenario for tree structures in excel?

What I can do rather easily, and what I think is more useful, is simply
a 1-level CSV export of a grid. It wouldn't export any hierarchy, but
it would allow grids to me moved back and forth between TreeSheets
and excel.

I can even imagine an algorithm to "flatten" a treesheet to a single,
e.g. if you had a 2x2 top level grid of which 1 cell contained another
2x2, flattening that would result in a 3x3 grid, which can then
be loaded into excel easily. However, again I am not sure what use
that would be, as the reverse transform is not generally possible.

Wouter

alx

unread,
Mar 3, 2009, 10:26:25 AM3/3/09
to TreeSheets
Re: CSV

I use Excel 2003. I selected *.csv (Comma Delimited) as type of file,
but it came out with ';'. As far as I know this is the default and I
can't see any way to change it. Version 2007 may differ. No sweat, I
can just search and replace the text file.

alx

unread,
Mar 3, 2009, 10:35:08 AM3/3/09
to TreeSheets
The main reason I worked with the indented text export was that it was
available; I agree that .CSV would be more useful for exporting to
Excel.

It think that it would be a shame to lose all the hierarchical info if
(at least some of) it can be retained. And it can; an extra ',' for
every level would push a grid to the next column, representing the
hierarchy via indentation. Also, if rows are exported as rows with ','
separating columns, that would maintain the integrity of subgrids.

A 1-level CSV export to Excel is nothing more than what already can be
done by copying the whole grid and pasting to Excel. But there on, it
can take ages to arrange. Nothing like the classy outline export to
Word.

Wouter van Oortmerssen

unread,
Mar 8, 2009, 10:24:05 PM3/8/09
to trees...@googlegroups.com

Adding a "CSV with semi colon" option is real easy... I have noted it
in the TODO, and if anyone else has problems with this too I'll add it.

Wouter

Reply all
Reply to author
Forward
0 new messages