[Python] Convert text file to excel sheet

Discussão em 'Python' iniciado por Stack, Agosto 10, 2025.

  1. Stack

    Stack Membro Participativo

    I have a text file with this format (the format is delimited by --- and |||| to make it look like a table)

    [​IMG]

    st
    ---------------------------------------------------------------------------------------------------------
    Server : hh site: Date : 2012-03-10 Run Time :00.00.00
    ---------------------------------------------------------------------------------------------------------
    AA |dd |condition |another |condition |Ref.
    yy |sa33 |true |OK: 4tu |true |yt.4.5
    | | | | |.3
    ---------|-----------------------|-------------------|---------------------------|-----------------|-----
    BB |tr dd |2 |dhfdk | |yt.5.1
    |verson | | t3hd | true |.1
    |and above) | | | |
    ---------|-----------------------|-------------------|---------------------------|-----------------|-----


    Content of the cell is all value. not heading. thanks

    I do not have any programming skills to read the file and parse it. How do I remove ---- and ||||| and import in Excel as row and columns.

    Continue reading...

Compartilhe esta Página