Hi there,
I've started to play around with the CAT (column aligned text) reader. Is there a way to specify column definition using another text or csv file instead of hardcoding it in the reader?
Any advice would be good.
Thanks,
W
Hi there,
I've started to play around with the CAT (column aligned text) reader. Is there a way to specify column definition using another text or csv file instead of hardcoding it in the reader?
Any advice would be good.
Thanks,
W
You can't dynamically set the column widths on the CAT reader. I think the best FME can offer is the TextLine Reader followed by the AttributeSplitter. To make that 'dynamic' you could try using a scripted parameter to set the AttributeSplitter's format string.
You can't dynamically set the column widths on the CAT reader. I think the best FME can offer is the TextLine Reader followed by the AttributeSplitter. To make that 'dynamic' you could try using a scripted parameter to set the AttributeSplitter's format string.
Â
Hi @generationn00b Can you please post a suggestion at https://knowledge.safe.com/content/idea/list.html about setting the CAT reader's schema with another file? I've seen this idea before.
Hi @generationn00b Can you please post a suggestion at https://knowledge.safe.com/content/idea/list.html about setting the CAT reader's schema with another file? I've seen this idea before.
Â
https://knowledge.safe.com/idea/71574/dynamically-set-the-column-definition-for-column-a.html?You can't dynamically set the column widths on the CAT reader. I think the best FME can offer is the TextLine Reader followed by the AttributeSplitter. To make that 'dynamic' you could try using a scripted parameter to set the AttributeSplitter's format string.
A possible workaround (or a hack ?) in the current version of FME is: use a FeatureReader to read a CAT file and create a published parameter linking to the schema parameter in the FeatureReader (CAT reader).
Then, you can set a schema through the published parameter with this syntax.
<field name>,<field type>,<column width> ,<field name>,<field type>,<column width>]*
e.g.
field1,Integer,5,field2,String,20,field3,String,15
See the parameters dialog of the CAT reader to learn possible field types.
Also you can run the workspace through a WorkspaceRunner within another workspace. In the case, you can set the schema through a feature attribute.
A possible workaround (or a hack ?) in the current version of FME is: use a FeatureReader to read a CAT file and create a published parameter linking to the schema parameter in the FeatureReader (CAT reader).
Then, you can set a schema through the published parameter with this syntax.
<field name>,<field type>,<column width> ,<field name>,<field type>,<column width>]*
e.g.
field1,Integer,5,field2,String,20,field3,String,15
See the parameters dialog of the CAT reader to learn possible field types.
Also you can run the workspace through a WorkspaceRunner within another workspace. In the case, you can set the schema through a feature attribute.
Â
Â
A possible workaround (or a hack ?) in the current version of FME is: use a FeatureReader to read a CAT file and create a published parameter linking to the schema parameter in the FeatureReader (CAT reader).
Then, you can set a schema through the published parameter with this syntax.
<field name>,<field type>,<column width> ,<field name>,<field type>,<column width>]*
e.g.
field1,Integer,5,field2,String,20,field3,String,15
See the parameters dialog of the CAT reader to learn possible field types.
Also you can run the workspace through a WorkspaceRunner within another workspace. In the case, you can set the schema through a feature attribute.
@generationn00b, @takashi, we are looking to use the same pattern to load CAT datasets.  Your post was very helpful; however, I still could not figure out how and where to "set the schema via parameters".  Do you mind providing a bit more detail or maybe a screenshot?  Thanks!
Â
Â