0

I have a complex Numbers.app spreadsheet which contains a table with cells that are colored with different background colors. The different colors represent essential information.

When I export the table to a CSV file in numbers (File > Export to… > CSV…) the color information is not included in the exported CSV in any way. That is a problem for me, since it is essential information.

Is there anyway to include the cell background color information in a CSV export? Of course I want to retain and export all of the other usual information in the CSV export as well. Any workaround which can export this color information in any kind of structured format would be acceptable/interesting to know.


Note: I did notice that this cell background color information is preserved when exporting to Excel format (File > Export to… > XLS…). If there is no more direct way, I would love to also hear about an option to first export to Excel, and then export from Excel to a CSV format which somehow includes the structured color information.


Also Note: Yes, of course I am aware that CSV is a text-only file format. But out-of-band info could theoretically be included in an export in some kind of format like hex_color_value:text_value for each cell (comma-separated value). Something like that would really be ideal…

10
  • 1
    Why do you need this information only in .CSV format? If you need the special formatting only Pages & Excel can provide, why can't you use those formats?
    – IconDaemon
    Commented Oct 13, 2022 at 22:15
  • I don't need special formatting at all. On the contrary, I need the data in plain text aka csv. But the color of the cells represents essential information in the spreadsheet… each different color has a special meaning in relation to the data in that cell. The colors are themselves part of the data, not the presentation. I need to include/encode this "out-of-band" color data in the exported csv somehow. Commented Oct 14, 2022 at 1:14
  • 3
    TBH/ you may need to rethink how to restructure your spreadsheets not to rely on what are just handy formatting options for the human brain to recognize/organize. I truly understand what you've done, and what you need, but I know of no methods to enable the representation of the formatting options in the data itself. Think outside the cell (row, column)!
    – IconDaemon
    Commented Oct 14, 2022 at 13:13
  • Restructuring the spreadsheets is not an option. I have inherited a large corpus of historical spreadsheets with this layout. The data must be extracted. And honestly, it's not such a strange situation… Non-programmers using color in a spreadsheet to represent essential data is honestly not even surprising, but rather to be expected occasionally. Exporting this aspect should be possible. Commented Oct 14, 2022 at 14:43
  • 1
    Sometimes a little background about why something is the way it is helps to frame the question and in the end frame a possible answer. Not knowing the types of data you're dealing with, and how the color coding helps organize the data makes it a challenge to give a useful answer. Since I can't 'see' how the data is organized, it is hard to give anything but generalized answers. I've seen some very complex spreadsheets in my time, and envisioning how to take aspects of the data visualization as represented by color and quantifying it into data seems to be an insurmountable problem ... for me.
    – IconDaemon
    Commented Oct 14, 2022 at 17:39

1 Answer 1

0

It's a bit of a round-about method, but you could create an AppleScript to loop through all of the cells of the original table and populate another table with the results. The following is an example of accessing the background color property of a cell:

tell application "Numbers"
    activate
    set mybgcolor to background color of cell "B5" of table 1 of sheet 1 of front document
end tell
1
  • 1
    This is only a partial answer, if at all. Pls do not post comments as answers and try to earn some reputation points so that you can write comments.
    – Alper
    Commented May 12, 2023 at 5:39

You must log in to answer this question.

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