Forum Discussion

anupambit1797's avatar
anupambit1797
Iron Contributor
Jun 12, 2023

Parse txt

Dear Expert,

                 Could you please share how to parse the attached txt to Excel ,

So for example the ones underlined in read should be in one row

and the second sub-headers in another row:-

 

and then the data row.

 

Many Thanks

Br,

Anupam

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    anupambit1797 

    I think you're trying to accomplish this?

     

    If so, you could use this:

    =LET(
        frame_subframe, CHOOSECOLS(data, {1, 2, 8, 9, 11, 12}),
        vector, TOCOL(frame_subframe),
        WRAPROWS(vector, 2)
    )

     

  • anupambit1797 

    What do you mean exactly - parsing in Power Query keeping sub-headers as rows before each section of data or something else? Perhaps you may share desired output, 2-3 columns is enough for the sample.

Resources