Ansible
Ansible Documentation
fsckzy
V2EX  ›  Ansible

Python 如何将 txt 导入 excel?

  •  
  •   fsckzy · Jan 4, 2018 · 6134 views
    This topic created in 3084 days ago, the information mentioned may be changed or developed.

    文件内容如下:

    7 replies    2018-01-04 21:07:40 +08:00
    lhx2008
        1
    lhx2008  
       Jan 4, 2018
    如果文件没有内容的话,就直接 open("xx.xls","w")就可以了(误)
    wsbnd9
        2
    wsbnd9  
       Jan 4, 2018
    按行读取 t x t 然后 循环写 exec l 很容易的
    kindjeff
        3
    kindjeff  
       Jan 4, 2018
    改名叫 csv,点开,另存为
    Magnus1k
        4
    Magnus1k  
       Jan 4, 2018
    cljnnn
        5
    cljnnn  
       Jan 4, 2018
    pandas 或许可以一战。
    pandas.read_table
    pandas.to_excel
    https://pandas.pydata.org/pandas-docs/stable/io.html
    upczww
        6
    upczww  
       Jan 4, 2018
    用 pandas 处理 csv, excel 很方便的
    ethanlu
        7
    ethanlu  
       Jan 4, 2018 via Android
    弱弱地问,excel 本身不是就可以导入 txt 咩
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3531 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 11:03 · PVG 19:03 · LAX 04:03 · JFK 07:03
    ♥ Do have faith in what you're doing.