Problem to convert a TXT file to Excel file with Macros

OmarGtz

New Member
Joined
Jan 26, 2015
Messages
1
Hi All,

I need to create a macro that allows me to convert a TXT file with multiple level headers that are repeated across each registry and sort them in a single column, I have not constructed any macro cause simply I'm lost on this, I appreciate your support!

Here the example

Registry 1
Header Lvl1 A space, space Header Lvl1 B space Header Lvl1 C
Data Lvl1 A space, space Data Lvl 1 B space Data Lvl 1 C
Header Lvl2 A space, space Header Lvl2 B space Header Lvl2 C
Data Lvl2 A space, space Data Lvl 2 B space Data Lvl 2 C
Header Lvl3 A space, space Header Lvl3 B space Header Lvl3 C
Data Lvl3 A space, space Data Lvl 3 B space Data Lvl 3 C
Registry 2
Header Lvl1 A space, space Header Lvl1 B space Header Lvl1 C
Data Lvl1 A space, space Data Lvl 1 B space Data Lvl 1 C
Header Lvl2 A space, space Header Lvl2 B space Header Lvl2 C
Data Lvl2 A space, space Data Lvl 2 B space Data Lvl 2 C
Header Lvl3 A space, space Header Lvl3 B space Header Lvl3 C
Data Lvl3 A space, space Data Lvl 3 B space Data Lvl 3 C

Please note that headers of each Level are the same within registries (Registry field doesn't exist) and Lvl1 is the one that actually differentiates each registry.

The expected result is:

Header Lvl1 A space, space Header Lvl1 B space Header Lvl1 C, Header Lvl2 A space, space Header Lvl2 B space Header Lvl2 C,Header Lvl3 A space, space Header Lvl3 B space Header Lvl3 C
Each data registry
listed below
Data Lvl1 A space, space Data Lvl 1 B space Data Lvl 1 C, Data Lvl2 A space, space Data Lvl 2 B space Data Lvl 2 C,Data Lvl3 A space, space Data Lvl 3 B space Data Lvl 3 C.


I really hope you can help me...
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top