Skip to main content
Question

CAT reader - missing fme_basename


sigtill
Supporter
Forum|alt.badge.img+24
Any way to get the CAT-reader to display its fme_basename?

7 replies

david_r
Celebrity
  • October 31, 2013
Hi,

 

 

sounds like a bug, but you can use an AttributeExposer to get the value regardless.

 

 

David

takashi
Evangelist
  • October 31, 2013
Hi Sig,

 

 

As Davied mentioned, the AttributeExposer exposes fme_basename and so on.

 

But in my test, fme_basename contains the folder name in which the input file is saved, not the file name. Maybe it's not what you need...

 

Tested in FME 2013 SP4.

 

 

If you need to get the input file name, how about the ParameterFetcher (fetch SourceDataset_CAT param value) and the FilenamePartExtractor?

 

Takashi

sigtill
Supporter
Forum|alt.badge.img+24
  • Author
  • Supporter
  • October 31, 2013
I need fme_basename to be the fme_basename :) - ie the filename + extension: myfile1.cat myfile2.cat etc.

 

 

So its a bug I guess, as mentioned the AttributeExposer does not work as expected.

 

 

The workaround was to use the solution below, thanks for giving me the right direction!:

 

 


takashi
Evangelist
  • November 1, 2013
Good to know you got a workaround.

 

The Text File reader + AttributeSplitter (split the text line with #s#s#s...) + AttributeRenamer could be also a workaround.

 

fme_basename and fme_dataset of the Text File reader contain file name (without extension) and full path of the source file.

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • November 1, 2013
Hi,

 

 

Why not just use the Directory and File Pathnames reader?

 

 


takashi
Evangelist
  • November 1, 2013
Hi Itay, I thought of that too, but couldn't find how to read the CAT file (and append the file name to CAT features) based on the source file path from the Directory and File Pathnames reader...

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • November 1, 2013
Hi Takashi,

 

 

I see what you mean.

 

 

Itay

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings