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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
KarMin
Contributor
Contributor

Create list of all files in a container and their content

Hi community,

have been working with talend for a couple of weeks now and found here important information.

Now I have a problem where I can´t find a solution for it.

I have a folder with several files ( ~2000). The goal is to get an delimited file with two column.

In column A should be the name of the file without the file extension and in column B should be the whole content of the file.

The files have different content:

  • One line.
  • many lines without empty lines
  • many ines with empty lines.

The content should be as one line in the column field.

 

Here a short example.

 

File A:

Name_of_file_A.txt

Content:

Good morning,

this is a test file.

thx

Tester

File B:

Name_of_file_B.txt

Content:

Only one line as content!

Result delimited file:

Content:

Name_of_file_A; Good morning, this is a test file. thx Tester

Name_of_file_B; Only one line as content!

I tried it with tFileList --> tFileInputFullRow --> tMap --> tFileOutputDelimited, but I got only the last file into it.

How can I go to get my wanted result?

Best regards

KarMin

Labels (2)
2 Replies
Anonymous
Not applicable

Check the 'Append' box on tFileOutputDelimited, otherwise, the job will create a new file for each iteration.

 

KarMin
Contributor
Contributor
Author

Great, this fix one of my problem.

 

Now I have still the main problem, that for all files with more than one line of content,

in the target file one row per content line will be created.

 

As for my example, for file A following entries will be created:

 

Name_of_file_A; Good morning,

Name_of_file_A; this is a test file.

Name_of_file_A; thx

Name_of_file_A; Tester

 

but in the end it should be:

 

Name_of_file_A; Good morning, this is a test file. thx Tester

 

How can this be reached?