Skip to main content

Trying to generate a list of word count for 250 text files grouped by fme_basename and after 180 rows (text_line_data) i get this error in my loop:

ListHistogrammerExtractor_AttributeCreator_4(TeeFactory): ListHistogrammerExtractor_AttributeCreator_4: @Tcl2 -- failed to evaluate expression ` 
ListHistogrammerExtractor_AttributeCreator_4_0794f8f3_f60b_4915_9438_12229fbdab5720_attrSetter {(<at>Value<openparen>_histogram<opencurly><at>Value<openparen>_loopCount<closeparen><closecurly>.value<closeparen>,<at>Value<openparen>_histogram<opencurly><at>Value<openparen>_loopCount<closeparen><closecurly>.count<closeparen>)} ' 
-- FME_SetAttribute procedure requires at least two parameters -- the attribute name, its value, and an optional encoding for the value.

All Form feeds are removed before the files are aggregated. I also tried removing non-printable characters, using the ListStringReplacer looking for regex: n\x00-\x1F\x80-\xFF]. The AttributeCreator uses the histogram list to pivot attributes. This is where it fails and I think an attribute value - which I can't identify right now - is causing the issue. 

The log is saying an option for attribute encoding but I don't see where I can add this Attribute Name expression.

I tried the @ConvertEncoding (<String1>, <String2>) in the Attribute Name and Attribute Value using unicode in String2 and neither worked.

0684Q00000ArCJNQA3.png

Update: I started doing random testing, one text file at a time, and the attached text file is the only one that has caused the issue so far. After completing the test for all text files, there 16 files that caused failure.

Hi @salvaleonrp,

How many words are you expecting for this file? I am getting 129 with this workspace.

listhistogrammer-attributecreator-error.fmw


Hi @salvaleonrp,

How many words are you expecting for this file? I am getting 129 with this workspace.

listhistogrammer-attributecreator-error.fmw

I should have added more details. I really need more than a word count ... I need the frequency of certain words so I can "teach FME to read the text" the way I want it to be read - top to bottom, left to right, and sifting out the table itself.

 

 


I figured out what was causing the issue: when the histogram().value is a hyphen, FME does not like it.

So with a stringreplacer Text to Match: \\B- to replace all single hyphen to space fixes my problem.


Reply