Question

How to modify multiple date data in a single fusion table cell to improve readability

  • 14 January 2016
  • 5 replies
  • 1 view

Badge

Hi I am wondering how would I manipulate multiple dates in a single fusion table cell so that it would improve its readability. I would be uploading this data onto a map and would be using html. I was thinking to utilise the break tag to split each line of date to the next line. Any help would be greatly appreciated thanks lots.


5 replies

Userlevel 2
Badge +17

Assuming that every date is formatted with "d/m/yy" always, this expression returns a string containing only dates separated by space(s).

@ReplaceRegEx(@ReplaceRegEx(@Value(OPERATING_HOURS),[^\s\d/]+,""),\s\d+\s,"")

The inside @ReplaceRegEx function replaces every character except {space, digits, slash} with the empty string. The outside one replaces every "<space>digit(s)<space>" in the returned string from the inside function with the empty string.

You can use the expression in the AttributeCreator (Value column) or StringConcatenator. Then, if necessay, you can split the resulting string with the AttributeSplitter to split the string into each date.

  • Delimiter or Format String: <a space>
  • Drop Empty Parts: Yes
Badge

Assuming that every date is formatted with "d/m/yy" always, this expression returns a string containing only dates separated by space(s).

@ReplaceRegEx(@ReplaceRegEx(@Value(OPERATING_HOURS),[^\s\d/]+,""),\s\d+\s,"")

The inside @ReplaceRegEx function replaces every character except {space, digits, slash} with the empty string. The outside one replaces every "<space>digit(s)<space>" in the returned string from the inside function with the empty string.

You can use the expression in the AttributeCreator (Value column) or StringConcatenator. Then, if necessay, you can split the resulting string with the AttributeSplitter to split the string into each date.

  • Delimiter or Format String: <a space>
  • Drop Empty Parts: Yes

Unfortunately each date is not formatted in d/m/yy as it has the day of the week and the time, thanks!

Userlevel 2
Badge +17

Unfortunately each date is not formatted in d/m/yy as it has the day of the week and the time, thanks!

If you can assume that the date entries are separated by a colon, the AttributeSplitter with setting a colon to the "Delimiter or Format String" parameter can be used to split them simply.

Userlevel 2
Badge +17

Unfortunately each date is not formatted in d/m/yy as it has the day of the week and the time, thanks!

ah, it seems that each date entry consists of these elements separated by space.

  • d/m/yy
  • the day of the week ending with a colon
  • time

Isn't it?

If so, the StringReplacer can be used to replace every space between different entries with a specific character (e.g. a pipe "|").

  • Text to Match: ([\\d/]+[^:]+:\\s[^\\s]+)\\s+
  • Replacement Text: \\1|
  • Use Regular Expressions: yes

Then, split the string by the specified character with the AttributeSplitter.

[Edited the regex]

Badge +3

i used on a bit of the value in the operating hours column in your posted jpg.

This regexp in the stringreplacer:

([\\d\\/]+\\s*\\w+:\\s\\w+\\-\\w+)

and i use replace \\1@ ( for i am not sure i see a ";"in the column, hard to see due to low res)

then a splitter with delimiter @

Gets all in a nice list.

Reply