Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
toos
Contributor
Contributor

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

Labels (2)
2 Replies
Anonymous
Not applicable

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

toos
Contributor
Contributor
Author

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