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: 
Anonymous
Not applicable

how to create mate data in talend

Hi Team,

 

I have txt file, i want to load in oracle table. Below is file format. It is possible to create meta data from below file contents in talend.

 

Report:212
date:21-02-2019
------------------------
no name col3
------------------------
02 sanajay sagar
03 xxx yyy

Report:213
date:21-02-2019
------------------------
no name col3
------------------------
05 zxz sa
06 ew qa

 

ID: 121
Row count: 4

 

Thanks

Shree

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Yes, please test the job flow and accept the post as solution if it fixes your need, it will helps others find helpful answers in the community too!

Regards
Shong

View solution in original post

13 Replies
Anonymous
Not applicable
Author

Hi,

What does your expected output look like?

In talend, you can centralize file metadata in repository. Here is online document about:TalendHelpCenter:Centralizing File Delimited metadata

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi Sabira.

 

Thanks for your input.

 

Please find the attached file.

 

How to create metadata for file, This file is system generated am sharing sample file contents.

 

Thanks

Shree


sample_text.txt
Anonymous
Not applicable
Author

Hello,

What does your expected output look like?

no;name;col3
02;sanajay;sagar
03;xxx;yyy
05;zxz;sa
06;ew;qa

Best regards

Sabrina

 

Anonymous
Not applicable
Author

Hi Sabira,

 

Yes, Below expected output.

 

no;name;col3
02;sanajay;sagar
03;xxx;yyy
05;zxz;sa
06;ew;qa

 

Kindly suggest how to implement or how to achieve this scenario.

 

Thanks

Shree

Anonymous
Not applicable
Author

Hi Shree
No a component can be used to extract the data directly from this file. If the format is fixed, I would suggest you to read the file line by line with tFileInputRaw component, then remove the useless lines like starting with "Report", "date", "---", ..., finally, extract the fields with tExtractDelimitedFields, the job looks like:
tFileInputRaw--main--tJavaRow--main--tExtractDelimitedFields--main--tOracleOutput

Hope it helps you!

Regards
Shong
Anonymous
Not applicable
Author

Sure Shong,

 

Let me try as mentioned flow. Let you know if i face any issues.

 

Thanks

Shree

Anonymous
Not applicable
Author

Hi Shong,

 

Can you give sample example to remove "Report", "date", "---", ..., using tJavaRow. 

 

I don't know java. May be i am asking simple/ silly question here.

 

Thanks

Shree

Anonymous
Not applicable
Author

Sorry, it was a mistake on my previous post, I meant to use tFileInputFullRow to read the file line by line, and use tFilterRow to remove the useless lines,
tFileInputFullRow--main--tFiterRow--main--tExtractDelimitedFields--tLogRow

on tFilterRow, check the 'use advanced mode' checkbox, and write these Java codes:
(!input_row.line.startsWith("Report"))&&(!input_row.line.startsWith("no name col3"))&&(!input_row.line.startsWith("------"))&&(!input_row.line.startsWith("date"))&&(!input_row.line.startsWith("ID"))&&(!input_row.line.startsWith("Row count"))&&(!input_row.line.startsWith(" "))

Regards
Shong
Anonymous
Not applicable
Author

Hi Shong,

 

No problem,  let me try this code.

 

Thanks

shree