Convert the content from multiple TXT or CSV files into Excel using Python (Real-World Example)

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 32

  • @CodingIsFun
    @CodingIsFun  2 ปีที่แล้ว +7

    I hope you liked this Python automation example.
    Here are the links ⤵
    🌟 Source code: github.com/Sven-Bo/merge-txt-files-export-to-xlsm
    🌟 Discord Server: pythonandvba.com/discord
    *Happy Coding!* 🚀

  • @brazilleros
    @brazilleros 2 ปีที่แล้ว +2

    Hi Sven! Thank you once again for guiding us through the python automation ideas and your brilliant solutions! Me and my colleagues are grateful for your help with "merging multiply pdf''s by name" project . Thank you for your time and kindful assistance.😇

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว +1

      Hi Anton. Thanks for watching the video and for your comment.
      Happy to hear that you are satisfied with your pdf solution. Glad I could help! :)

  • @TimePasser
    @TimePasser 2 ปีที่แล้ว +2

    Another practical cool tutorial from the legend. Thank you 😊

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      Happy to hear that you enjoyed this one too! Thanks for the comments and support, as always!

  • @florianroeseler2404
    @florianroeseler2404 2 ปีที่แล้ว

    Extremely helpful, thank you!!

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      Glad it was helpful, Florian!

  • @wayneqwele8847
    @wayneqwele8847 2 ปีที่แล้ว

    That was helpful, much appreciated!

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video!

  • @patriciohernandezballester2485
    @patriciohernandezballester2485 2 ปีที่แล้ว

    How wonderful! Superb!

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      Thank you, Patricio! Also, many thanks for the outstanding contribution to our Discord channel! 👍

    • @patriciohernandezballester2485
      @patriciohernandezballester2485 2 ปีที่แล้ว

      @@CodingIsFun Always thanks to you and the discord community. My summer holidays from work are over. When I get time again, I'll keep contributing. Thanks for the magnificent work teaching and in the production of digital content, because you are a source of inspiration for many young programmers ... well, and not so young 🤩

  • @sujungpark5764
    @sujungpark5764 2 ปีที่แล้ว

    It is really helpful ! Thank you so much :)

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      An absolute pleasure, very happy to hear that you found it useful!

  • @MrDanilofontana
    @MrDanilofontana 2 ปีที่แล้ว

    Very nice example! I have a small question, why do you define the current_dir like that? I am always using something like os.getcwd() but now I am not sure if this is more efficient or not. Would you know if there is any difference? Thanks in advance and congratz for your content!

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      Thank you!
      You can also use the os module. There is nothing wrong with that.
      However, some viewers might have set their current working directory to a different folder. In that case, the script will return an error. Hence, I am using the (slightly convoluted) inline if statement with pathlib.

  • @walidmat8972
    @walidmat8972 2 ปีที่แล้ว

    very cool video as usual 👌

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว +1

      Thank you! Glad you liked this one too! :)

  • @rdtw8988
    @rdtw8988 ปีที่แล้ว

    Hi Sven,
    Thanks for the detailed coding explanation. It is very helpful.
    I also wnonder, if you change the file name from Student_number_Eng/Math to Student_Eng/Math_number, how would you change your code? Let say, the student number is from 001 to 100. I tried to use for loop, but it seems like python doesn't like it.

    • @CodingIsFun
      @CodingIsFun  ปีที่แล้ว

      Thanks so much for watching the video and leaving a comment! Your request is definitely noted. However, I get a ton of requests for custom solutions and, as much as I'd love to help everyone out, I just don't have the time in my schedule to develop and test all of them. I hope you can understand. Happy Coding!

  • @leonpheonix2745
    @leonpheonix2745 ปีที่แล้ว

    When i'm defining current_dir i'm getting an error "cwd() takes 1 positional arguments bur 2 were given"

    • @CodingIsFun
      @CodingIsFun  ปีที่แล้ว

      Thanks for watching. Please clone the GitHub repo and try again. Thanks!

  • @ibrahimsaiusman6115
    @ibrahimsaiusman6115 10 หลายเดือนก่อน

    Greetings
    I have tons of files to process and I need to merge daily data files to monthly. Also, each file contains headings (55 lines) and the main body (343 lines).
    please assist. NB: the file extension is .trop

    • @CodingIsFun
      @CodingIsFun  10 หลายเดือนก่อน

      Thanks so much for watching the video and leaving a comment! Your request is definitely noted. However, I get a ton of requests for custom solutions and, as much as I'd love to help everyone out, I just don't have the time in my schedule to develop and test all of them. I hope you can understand. Happy Coding!

  • @zhecao6586
    @zhecao6586 2 ปีที่แล้ว

    Hi, it is very helpful. I have an issue when I tried to do this. I got with xw.App(visible=False) as app: AttributeError: __enter__ . Do you know why it happens. Thank you.

    • @CodingIsFun
      @CodingIsFun  2 ปีที่แล้ว

      Thanks for watching. Please use the latest version of xlwings. If that does not resolve the issue, please try another Python version. In the video I have used 3.8.5

  • @RaviKumar-n8w1p
    @RaviKumar-n8w1p 2 หลายเดือนก่อน

    line 22, in
    wb = app.books.open(excel_template). I got some error plz help ?

    • @CodingIsFun
      @CodingIsFun  2 หลายเดือนก่อน

      Thanks for watching, but with that bit of information ("I got some error"), I cannot help you. Sorry! 😅 Cheers, Sven ✌️

    • @RaviKumar-n8w1p
      @RaviKumar-n8w1p 2 หลายเดือนก่อน

      @@CodingIsFun thanx for you reply. error solved

    • @CodingIsFun
      @CodingIsFun  2 หลายเดือนก่อน +1

      @@RaviKumar-n8w1p what was the solution?

  • @udayrajvadeghar8555
    @udayrajvadeghar8555 ปีที่แล้ว

    f you are unable to do . open the terminal in the directory and run this command .
    "Get-ChildItem -Filter *.txt | Rename-Item -NewName { $_.Name -replace '\.txt$', '.csv' }"
    here i am converting txt files to csv files , replace on that you want to convert .

    • @CodingIsFun
      @CodingIsFun  ปีที่แล้ว

      Thanks for watching. I think the use case was slightly more complicated 😅, but thanks for the info! I appreciate it! 👍