Skip to main content
Solved

Hello, I'm using a string searcher to find "Dates" out of a "Comments" field. I have a column of all matches (Screen shot attached). How can i extract the most recent date out of all matches? Probably would help if I change "/" to another symbo

  • November 29, 2022
  • 1 reply
  • 15 views

Hello, I'm using a string searcher to find "Dates" out of a "Comments" field. I have a column of all matches (Screen shot attached). How can i extract the most recent date out of all matches? Probably would help if I change "/" to another symbol.

Best answer by markatsafe

@egeiser​ You can match the dates with the regex: (\\d{1,2}/\\d{1,2}/\\d{1,2}) in the StringSearcher. Under Advanced, add an All Matches List Name: _allDates. If the last date in the pattern is always your recent date then you can just use ListIndex with List Index to Copy: -1

If the last date in the list isn't the most recent, then you'll have to explode the list, Use DateTimeConverter to make the date an FME date and then pick out the most recent from there

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.

1 reply

Forum|alt.badge.img+2
  • 1891 replies
  • Best Answer
  • November 29, 2022

@egeiser​ You can match the dates with the regex: (\\d{1,2}/\\d{1,2}/\\d{1,2}) in the StringSearcher. Under Advanced, add an All Matches List Name: _allDates. If the last date in the pattern is always your recent date then you can just use ListIndex with List Index to Copy: -1

If the last date in the list isn't the most recent, then you'll have to explode the list, Use DateTimeConverter to make the date an FME date and then pick out the most recent from there