Skip to main content
Question

CAT reader - missing fme_basename

  • October 31, 2013
  • 7 replies
  • 24 views

sigtill
Supporter
Forum|alt.badge.img+25
Any way to get the CAT-reader to display its fme_basename?
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.

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
Celebrity
  • 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+25
  • 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
Celebrity
  • 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+21
  • Safer
  • November 1, 2013
Hi,

 

 

Why not just use the Directory and File Pathnames reader?

 

 


takashi
Celebrity
  • 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+21
  • Safer
  • November 1, 2013
Hi Takashi,

 

 

I see what you mean.

 

 

Itay