Reading data from unstructured File

Five Stars

Reading data from unstructured File

Hello All,

 

I have a file like below which is un structured. The real data starts from line number 10. We can use tfileinput delimiter for that with having header as 10. But i would like to take the values which is right to "Game DATE" and "TRIG: CO." . These are in line numbers 6 and 8. I need to take those values and have them as two fields along with the actual data set, whcih starts form Line number 10. Kindly advise on this. 

 

"SSG TRIG: S81GS146"
"END GAME"
"Player Place - NY"

" Game DATE:","11/27/2018"
"CURRENT DATE:","11/27/2018"

"TRIG: CO.  (TEAMS)"
"TEAM", " T1 ","T2 "," EXC "," TYEN "," "
"NO. "," SWQ ","SDD "," TIONS "," TIONS "," FINAL "
"S1 ",    80.00 , 000.00 , 000.00 ,   000.00 ,   000.00
"S2 ",    70.00 , 000.00 , 000.00 ,   000.00 ,   000.00

 

 

Output I required should be of below format.

"Game DATE" "TRIG: CO." "NO. "," SWQ ","SDD "," TIONS " ," TIONS ", " FINAL "
"11/27/2018,            81,         "S1 ",80.00 ,   000.00 ,  000.00 ,   000.00 ,   000.00
"11/27/2018,            81,         "S2 ",70.00 ,   000.00 ,  000.00 ,   000.00 ,   000.00

Nine Stars

Re: Reading data from unstructured File

You'll probably need two hits at reading the data in, firstly reading full row, for 1 rows. Inspect each line and extract data if its what you want. secondly, for the data rows, with a header size of 10 to skip the "header".

 

Thanks

 

David

Regards David
Dont forget to give Kudos when an answer is helpful or mark the answer as the solution.
Moderator

Re: Reading data from unstructured File

Hello,

Here is a TalendHelpCenter:tFileInputRaw in talend which reads all data in a raw file and sends it to a single output column for subsequent processing by another component.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: Reading data from unstructured File

Hi ,

 

May i know what component we can use to read data from Raw input, because I have consider two rows in the incoming files as tow columns . 

Five Stars

Re: Reading data from unstructured File

Hi David, thanks, can you please help me more with inspect each lines and extract . The second option I have done already and its is bringing the data to my output. But the first part , I am still not able to achieve. Kindly help. 

Moderator

Re: Reading data from unstructured File

Hello,


@kprsabarish wrote:

Hi ,

 

May i know what component we can use to read data from Raw input, because I have consider two rows in the incoming files as tow columns . 


Is this tfileinputraw component OK with you?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: Reading data from unstructured File

Hi Sabrina,

 

I am able to take all the data into one column, but how I have to split it in different columns, is what confusing. Since im yet to explore Talend much, i am not able to proceed further. 

 

Regards,

MS

Nine Stars

Re: Reading data from unstructured File

Hi,

 

Use something like:

 

tFileInputFullRow (read in only the 1st 10 rows ) ->tJavaRow - if this rows contains text of interest, extract & place into global map.

V

tFileInputDelimted (skip 1st 10 rows) -> tJavaRow (add in columns of interest values from previous step) -> more stuff

 

Regards David
Dont forget to give Kudos when an answer is helpful or mark the answer as the solution.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now