How to read first and last row of XML file.
Thanks in advance
While reading the file, you can pass the ((Integer)globalMap.get("tFileInputXML_1_NB_LINE")) parameter also to the subsequent data flow and use this value to pick the first and last rows.
where should I pass NB_LINE
or is there any way to read a file in reverse order like the last record then second last and so on.
My sincere apologies as I read the requirement slightly different way. If you want to read the line numbers for each column, the best way is to add a sequence and transfer the data to an additional line number column.
I have shown it for a delimited file but the theory remains same for xml file also.
Once you got the line numbers for each row, you can choose the data in any order using a tsortrow and tfilterrow components.
actually, we are just finding the shortest/smartest way to validate XML files.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Create systems and workflow to manage clean data ingestion and data transformation.