0

I need to interleave carton header codes and then the contents of the carton into a single column. Above that is a shipment header that starts the file. This is to be saved as a .txt file

Input a is a single line of text made up of the date, invoice number and supplier code,

10I393924Y0032520221031 SC150894 USD

Input b Sheet 1 contains column a & B, with A containing the carton number and B the code

1 203924Y01999
2 203924Y02000
3 203924Y02001

input c Sheet 2 contains the contents in each carton, Column A is the carton and Column B is the contents. So in Carton 1 you could have many contents all with "1" in column A and their description code

1 300651889297 2022-05-003831 0000539 S24210039070
1 300651889313 2022-05-003831 0001039 S24210039071
2 300651889313 2022-05-003831 0001039 S24210039095
2 300651889313 2022-05-003831 0001039 S24210039096
2 300651889313 2022-05-003831 0001039 S24210039097
2 300651889313 2022-05-003831 0001039 S24210039098
3 300651889313 2022-05-003831 0001039 S24210039120
3 300651889313 2022-05-003831 0001039 S24210039121
3 300651889313 2022-05-003831 0001039 S24210039122
3 300651889313 2022-05-003831 0001039 S24210039123
3 300651889313 2022-05-003831 0001039 S24210039124
3 300651889313 2022-05-003831 0001039 S24210039125

So after the header is input at the top the next task is to combine the B columns of input b and input c based on the code in Column A of the respective input sheets[text](https://www.stackoverflow.com/)

Output the final file needs to be saved as a .txt file and contain a single column of the combined data.

Input a
Input b - carton 1
Input c - contents of carton 1
Input b - carton 2
Input c - contents of carton 2
and so on until there are no more cartons to combine.

output file looks like this

10I393924Y0032520221031 SC150894 USD
203924Y01999
300651889297 2022-05-003831 0000539 S24210039070
300651889313 2022-05-003831 0001039 S24210039071
203924Y02000
300651889313 2022-05-003831 0001039 S24210039095
300651889313 2022-05-003831 0001039 S24210039096
300651889313 2022-05-003831 0001039 S24210039097
300651889313 2022-05-003831 0001039 S24210039098
203924Y02001
300651889313 2022-05-003831 0001039 S24210039120
300651889313 2022-05-003831 0001039 S24210039121
300651889313 2022-05-003831 0001039 S24210039122
300651889313 2022-05-003831 0001039 S24210039123
300651889313 2022-05-003831 0001039 S24210039124
300651889313 2022-05-003831 0001039 S24210039125

I've been combining these manually for 8 years! yes really. But hoping for an elegant solution to integrate into excel.

I can interleave the columns but not based on the contents of the adjacent column

0 Answers0