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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

read file and split data line by line into DB

I have a file :
FileType00000001~CustomerLoad~83e3ec9b-d824-48a5-8102-773b72ad8cca~20120717101648
#KeyDefinitionField~ImpGuid~RowId~FirstName~LastName~RsaId~PassportNumber~IfaNumber~HomeTelephone~WorkTelephone~MobileTelephone~Fax~EmailAddress
#KeyDefinitionField~ImpGuid~RowId~PolicyNumber~PolicyStatus~PolicyPremium
Customer00000001~~0~Nobongile~Langa~~~~~~~~
Policy0000000001~~0~402060005~I~99.00
Customer00000001~~1~Nobongile~Langa~~~~~~~~
Policy0000000001~~1~610473373~I~135.00
Customer00000001~~2~Nobongile~Mabunda~~~~~~~~
Policy0000000001~~2~403897536~I~99.00
Customer00000001~~3~Nobonile~August~~~~~~~~
I want to be ale to read line by line, check whether it is a Customer00000001 or Policy0000000001 and populate 2 different tables depending on what row i am in .
apologies still new to talend (java) .
regards
Labels (3)
5 Replies
Anonymous
Not applicable

HI
You might create a job as the following images.
Code in tExtractRegexFields
"^Policy0000000001"

or
"^Customer00000001"

Regards,
Pedro
_AnonymousUser
Specialist III
Specialist III
Author

okay ... that is what i was looking for.
a final question ? the entire row is put in one column, must I write to a temp file and extract from that temp file into the DB (separating the tilde delimited values) or is there and easier way.
I aso suppose i need to do this in 2 cycle , one for Customer0000001 and one for Policy00000001.
Regards
Anonymous
Not applicable

Hi
Yes. You need to create two subjobs for this.
tFileInputDelimited--main-->tExtractRegexFields--main-->tExtractPostionalFields--main-->Output
The tExtractPostionalFields can help you extract columns with fixed pattern.
Regards,
Pedro
_AnonymousUser
Specialist III
Specialist III
Author

THANKS PEDRO
GREAT HELP !!!!!
Anonymous
Not applicable

Hi,
You could also split the row by a tMap.
Create 2 output rows from one tMap where you filter the output on the substring Customer and Policy
this way you only need to parse your input file once.
Regards,
Arno