Skip to main content
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
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
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

 

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} {tFME_AttributeExists "_list{$i}"]} {incr i} {

 

       lappend values lFME_GetAttribute "_list{$i}"]

 

   }

 

   set index Âlsearch -exact -nocase $values xFME_GetAttribute "_pattern"]]

 

   if {0 <= $index} {

 

       FME_SetAttribute "_first_matched_element" tlindex $values $index]

 

   }

 

   return $index

 

}

 

-----
mailto insertion...how do i prevent this postingsystem doing that?
Gio, try use "Add a code smple". I've never used it...

 

 


Reply