Skip to main content
Released

Ability to read formatting from excel, especially background colour

Related products:Integrations
  • October 13, 2017
  • 4 replies
  • 60 views

iew
Contributor
Forum|alt.badge.img+6

Have large number of excel files where some of the data needs to be extracted and converted into a spatial dataset. From one part of the worksheet the cell to be extracted has a background fill so need to be able to detect which cell this is.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

martinkoch
Enthusiast
Forum|alt.badge.img+25
  • Enthusiast
  • January 21, 2021

Is the current ability to read formatting not enough?

Sorry I can't add screenshots here.. but when adding an Excel-reader, and indicating what to do with which tab, you can tick 'read formatting (.formatting).

 

This will add a formatting-attribute for each cell.

A non-background-filled cell will yield 'missing'

A yellow filled cell will yield 'version<semicolon>1<semicolon>pattern_style<semicolon>FILLPATTERN_SOLID<semicolon>pattern_color<semicolon>1<comma>1<comma>0'

A red one

version<semicolon>1<semicolon>pattern_style<semicolon>FILLPATTERN_SOLID<semicolon>pattern_color<semicolon>0.7529411764705882<comma>0<comma>0

 

Sure with some clever text searching and decoding this can be used...

 

Read https://docs.safe.com/fme/2021.0/html/FME_Desktop_Documentation/FME_ReadersWriters/xlsx/XLSX_reader.htm

at the end

or

https://docs.safe.com/fme/2021.0/html/FME_Desktop_Documentation/FME_ReadersWriters/xlsx/xlsx.htm

at usage-notes Formatting

 

Kind regards,

Martin


  • March 29, 2022

I was searching for a similar solution and noticed that cell colors that doesn't have at least one zero value in rgb, results in same formatting string values as white cells in fme. For example:

 

Gray cell with rgb values: 191,191,191 or orange cell with rgb values: 247,150,70 results in "pattern_color<semicolon>1<comma>1<comma>1" which is exactly same formatting as white cells

 

However, blue cell with rgb values 0,112,192 results in pattern_color<semicolon>0<comma>0.4392156862745098<comma>0.7529411764705882 and red cell with rgb values 255,0,0 results in pattern_color<semicolon>1<comma>0<comma>0

 

FME version used 2021.0


martinkoch
Enthusiast
Forum|alt.badge.img+25
  • Enthusiast
  • March 29, 2022

If this is consistent, you could file a bug..... Perhaps check it first in the latest version 2021.2.4...


LizAtSafe
Safer
Forum|alt.badge.img+21
  • Safer
  • June 15, 2024
https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/xlsx/XLSX_reader.htm