I have a text file like this:
and I would like to organize into Excel like this:
I could do this by hand manually for two data entries, but I would like to be able to automate this for a larger scale. What I've tried so far is to input the data into Excel using its built-in feature, but that's where I'm stuck. I tried to transpose the columns into rows, but that doesn't neatly organize it like I want it. Do I need to do some coding or is there a built-in function? If I do need coding, could someone point me in the right direction?
Thanks for your time!
I would try the Power Query Add-In for this. It has powerful commands for manipulating data. There are functions underneath, but you can achieve a lot by just clicking the buttons in the Power Query window. Working visually in Power Query is usually much easier than coding in VBA.
I had a go at this particular challenge and got it working. You can download and use my demo file from my OneDrive:
It's the file: Power Query demo - reorganising rows into columns.xlsx
As described on the ReadMe sheet, I only had to write one simple function - the rest was just clicking around the UI. Power Query is great!
To use it against your own text files, just Edit the first Step in the Query to point to your file. BTW you can even get Power Query to loop over the files in a folder if required.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments