I have a use case where a file comes to my system daily has multiple headers.
The no. of header counts are not same for each file. They can be 1,5,10, etc but there is an identification that says where the header ends.
E.g Inside the file, here in the below example the record begins with "Cards_14Q1_1" then headers, end of header(EOH), actual data header followed by actual data elements
Feed Name| Load Status|Date
AccId|Branch Address|Legal Entity|Cross Border
Expected output after removing the headers:
Solved! Go to Solution.
Are you looking for the following output?
flag: row2.line.equals("Cards_14Q1_1")?false:row2.line.equals("AccId|Branch Address|Legal Entity|Cross Border")?true:Var.PreFalg
try with this
flag=row2.line.equals("AccId|Branch Address|Legal Entity|Cross Border")?true:Var.PreFalg==null?false:Var.PreFalg
I have same issue and I am new to Talend. The way we are hard coding the Header Record is not going to solve my problem. The logic I want to implement is remove all the records preceding EOH and one record after EOH. Is there any dynamic Solution? I am thinking of the following, but not able to design.
1. Assign Record Number to each Record.
2. Find out the Record Number with "EOH" Say EOHRECNUM (Any other record having EOH in between field will not qualify, eg GEOHYDRO)
3. Write an expression to filter record number less than equals to EOHRECNUM + 1