Question

Merging text Files Many to One with one header

  • 15 August 2019
  • 2 replies
  • 14 views

I have some text files, same schema, to merge into one text.

 

How can I accomplish this without connecting each file one by one to the single output text file and keeping only the header from the first one?

 

 

e.g.

 

header_1

 

header_2

 

header_3

 

header_4

 

text_1

 

text_1

 

text_1

 

header_1

 

header_2

 

header_3

 

header_4

 

text_2

 

text_2

 

text_2

 

 

I want to exclude the headers from 2,3,4...files, so that i get:

 

 

header_1

 

header_2

 

header_3

 

header_4

 

text_1

 

text_1

 

text_1

 

text_2

 

text_2

 

text_2

 

 

Thanks.

2 replies

Userlevel 4
Badge +25

If it's always the same number of lines for the header you can use one Textfile reader for the first one and a second one for all the other files, specify the second one to skip the first x lines of the input files (i.e. the header)

Badge

You can read all the files at once using the "Select Multiple Folder/Files" option in the text reader . After that, you have to classify your data in type "header" or "content" by any criteria you have in your bussiness rule ( by prefix for eg). So you can use a duplicate filter to remove the header repetions.

 

Remove_Dup_Headers.fmwfile01.txtfile02.txt.

 

Hope it helps !!!

 

Reply