Forum Discussion

BenjaminChew's avatar
BenjaminChew
Copper Contributor
Mar 12, 2022

Converting hierarchy indent into columns

I have a text file with the following format

 

Admin

    HR

    Accounts

IT

   Support

   Technical

       Software

       Hardware

 

the expected result after copying to excel

Column 1Column 2Column 3
AdminHR 
AdminAccounts 
ITSupport 
ITTechnical 
ITTechnicalSoftware
ITTechnicalHardware

1 Reply

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    BenjaminChew Provided that the text file contains a consistent number of spaces before each sub-department, you could used Power Query to create the desired column layout. Attached a workbook with two very crude examples.

     

     

Resources