Skip to main content
Question

post to fmepedia

  • May 29, 2014
  • 5 replies
  • 24 views

darkspatiallord
Contributor
Forum|alt.badge.img+7
Hi

 

Can you use a Case Changer on an unexploded list.

 

So all values within that list are put to the same case so it makes it easier for ListSearcher queries to work (or can I do something in the ListSearcher to make this happen)

 

 

DL
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.

5 replies

takashi
Celebrity
  • May 29, 2014
Hi,

 

 

The ListSearcher seems not to have case insensitive option.

 

A workaround I can think of is:

 

1) Concatenate the list using the ListConcatenator.

 

2) Change case of the concatenated string using the StringCaseChanger.

 

3) Transform the concatenated string into a list using the AttributeSplitter.

 

4) Then, apply the ListSearcher.

 

 

Alternatively, a Python or Tcl script could be an effective solution for searching a matched list element in the condition of case insensitive.

 

 

Takashi

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 2, 2014
ListSearcher regular expression is strangely limited. It does not accept a lot of switches. One of those is the nocase switch. Alas.

 

 

The switches do work if u use listsearcher tcl in a attributecreator or expressionevaluator

 

[regexp -nocase -all -inline {@Value(expression ()) } @Value(Attribute)]  or something like that.

takashi
Celebrity
  • June 2, 2014
For example, the TclCaller with this script extracts first matched element and index in the list with "_pattern" in case-insensitive manner.

 

-----

 

proc searchList {} {

 

   set values {}

 

   for {set i 0} {[FME_AttributeExists "_list{$i}"]} {incr i} {

 

       lappend values [FME_GetAttribute "_list{$i}"]

 

   }

 

   set index [lsearch -exact -nocase $values [FME_GetAttribute "_pattern"]]

 

   if {0 <= $index} {

 

       FME_SetAttribute "_first_matched_element" [lindex $values $index]

 

   }

 

   return $index

 

}

 

-----

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 2, 2014
mailto insertion...how do i prevent this postingsystem doing that?

takashi
Celebrity
  • June 2, 2014
Gio, try use "Add a code smple". I've never used it...