Skip to main content
Question

Merging text Files Many to One with one header


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

redgeographics
Celebrity
Forum|alt.badge.img+49

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)


heidelbergh
Forum|alt.badge.img

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 !!!

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings