• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Split to an hierarchy

#1 2012-05-11 10:41:10

Manuel Gomes
Member
Company: Bayer
Registered: 2010-10-05
Posts: 10

[resolved] Split to an hierarchy

Hey,

I'm processing a csv file that contains one field that has a folder hierarchy like:

"FOLDER1\FOLDER2\FOLDER3\FOLDER4"

This a folder list that I need to import to a table like:
FOLDER_ID | PARENT_FOLDER_ID | FOLDER_NAME

So I need to parse each of the rows in the csv file into something like:

PARENT_FOLDER | FOLDER
              | FOLDER1
FOLDER1 | FOLDER2
FOLDER2 | FOLDER3
FOLDER3 | FOLDER4

... so that I can insert it in the database.

Any ideas to solve this?

Thanks a lot!
Manuel Gomes

Offline

#2 2012-05-11 11:14:20

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] Split to an hierarchy

Hi

Input data

Code:

FOLDER1\FOLDER2\FOLDER3\FOLDER4

The following images will explain it.

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

#3 2012-05-11 11:34:19

Manuel Gomes
Member
Company: Bayer
Registered: 2010-10-05
Posts: 10

Re: [resolved] Split to an hierarchy

Thanks a lot for the reply.

How to you get the last part, in the tMap, to work?
I'm getting "dir_tMemorizeRows_1 cannot be resolved to a variable".

Offline

#4 2012-05-11 11:36:55

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] Split to an hierarchy

Hi

Please upload a screenshot about the settings of tMemorizeRows.

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-05-11 11:53:27

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] Split to an hierarchy

Hi

Please notice the Limits: 20 images per post, each image must be less then 1024x768 pixels and 200 KB.

Regards,
Pedro


Only Paranoid Survive.

Offline

#6 2012-05-11 11:57:16

Manuel Gomes
Member
Company: Bayer
Registered: 2010-10-05
Posts: 10

Re: [resolved] Split to an hierarchy

Here you go... Thanks!


Uploaded Images

Offline

#7 2012-05-11 11:59:31

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] Split to an hierarchy

Hi

Because the column name in your job is Folder_Name, the expression should be Folder_Name_tMemorizeRows_1[0], Folder_Name_tMemorizeRows_1[1].

ColumnName_ComponentName[0]

Regards,
Pedro


Only Paranoid Survive.

Offline

#8 2012-05-11 12:02:20

Manuel Gomes
Member
Company: Bayer
Registered: 2010-10-05
Posts: 10

Re: [resolved] Split to an hierarchy

Correct.. I was not getting the part of the "dir_" part.. It's working fine now.

Thanks a lot for all the help.
Manuel Gomes

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Split to an hierarchy

Board footer

Powered by FluxBB