Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.4K Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

Exporting and importing a table

5 Replies
POSTED BY: Henrik Schachner
Posted 11 years ago
POSTED BY: David Keith

That was absolutely great. Thanks a lot.

Posted 11 years ago

I believe the root cause of the problem is the inconsistent row format. The two rows of data you post have different structures. In the first row, columns 10 and 11 each contain a 2 element list; in the second row they contain strings. This is especially a problem for exporting as a table, like csv or tsv, because what is needed is a 2 dimensional array of atomic objects. If this is the only structure issue, the data could be reprocessed to fix it. For example, when a two element list of strings is encountered on the 2nd level it could be replaced by a single string which is the two strings joined with a delimiter of some kind. But, if this data was generated in prior computation, it would perhaps be better to just correct the issue there. Once done, Export in table format should work fine.

POSTED BY: David Keith

Hi David,

I tried to avoid the solution proposed in your advice, but it seems that there is no other easy way to do that. So I built two functions to handle the problem. The first function converts the lists inside the table to single strings (as you suggested) and then exports the whole table to a file. The second function undoes the work of the first function.

Thanks a lot for your help.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard