TOS V7 : choice of tFileInput component for specific input file

Five Stars

TOS V7 : choice of tFileInput component for specific input file

Hi,

my input file has this specific format :

	<PIN_NUMBER> 	T001 
	<NAME> 	TR_125E 
	<OPERATIONAL_NAME> 	TR_125E 
			<TYPE> 	ARRIVEE 
			<VISU> 	ANY 
			<ATTRIBUT> 	SANS 
			<BALISES> 
						 A1	COMP_AAA	(PRINTABLE)
						 B1	(PRINTABLE)
					         C1	CC_LORNI	(PRINTABLE)
						<END_LIST> 

Could you suggest me, which component of Talend would be the most appropriate to read this file?

Best regards

Employee

Re: TOS V7 : choice of tFileInput component for specific input file

Hi,

 

    Since the file is not any specific format, why don't you try reading it using a tinputdelimited component with a rare field separator like "!!!!!!!". This will parse entire line as a single string field. Then use regular expressions within tmap/tjavarow to parse the fields based on proper if else conditions.

 

pseudo logic :-

if substring (input_row.inboundstring,10) is equal to  "<PIN_NUMBER>"

            {

            output_row.pin_number = trim(substring (input_row.inboundstring,11, string_length() )

            }

 

      Bit circuitous way but it should help in your case.

Warm Regards,

Nikhil

Five Stars

Re: TOS V7 : choice of tFileInput component for specific input file

Yes, I can also use the tFileInputRow/tFileInputFullRow or tFileInputRegex (?), but I'd like to find a  better solutions ...

Thank you for your attention Nikhil

Best Regards

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog