Automatically Fill Word Files with Python

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

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

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

    I did something like this without extra packaged once in javascript. Just reading the file. You have to make sure the placeholders aren't splitted (which can happen in doc files, there can be tags within a word - you can edit the template though), but besides that it's a pretty forward string replacement.
    This solutions seems to be way more easier though :)

  • @samrijijkot
    @samrijijkot ปีที่แล้ว +5

    Would also be interesting to see a good way to create pdf files with python via latex.

  • @saadzahem
    @saadzahem ปีที่แล้ว +5

    What about filling pdf files? Or automated convertion of docx to pdf.

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

    I did create something exactly like this with some additional features. I have been using replace instead of runs but sometimes that indeed leads to formatting issues. I used this to create 83 documents at once which is very valueable. Sometimes the date formatting in excel is an issue but that can be solved by converting it to text. With your csv approach that isn't an issue although for a user xlsx shows a better overview. Mine also automatically detects the headers instead of hardcoding them.

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

      do you think this could be way to create program that may help accountant to make his life easier?

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

      @@MrMKA2012 yes we have been using this at my firm. If you have some word document that needs to be created semiregularly it is worth the time. The word templates need some work put in them, but overall this saved around 26 hours of work. Prospectively more once used more. The tool is universal. I created a column in the excel input with the template names so that it fills several templates from one row iteratively.

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

      Well that is great, now will consider invest time in learning this , Thank you for telling your experience.@@MrRichy124

  • @hoanguyenthithu6572
    @hoanguyenthithu6572 4 หลายเดือนก่อน

    Thanks so much for your sharing. It works really well. This saves my time. Keep up with your good work!

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

    Great video!

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

    Which OS is this?

  • @yoorimgye8896
    @yoorimgye8896 4 หลายเดือนก่อน

    Thank you, master

  • @r00tey545
    @r00tey545 11 หลายเดือนก่อน +2

    Sadly getting the error - in terminal:
    raise PackageNotFoundError("Package not found at '%s'" % pkg_file)
    docx.opc.exceptions.PackageNotFoundError: Package not found at 'template1.docx'

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

      I get the same error!

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

      However, I found out that the error appeared because of the fact that the document was open when I ran the code.

  • @jackbauer322
    @jackbauer322 6 หลายเดือนก่อน

    What if I wanted to fill the file with an LLM generation ?

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

    wasn't auto fill in template is a built-in feature?

  • @wesamkiwan9561
    @wesamkiwan9561 5 หลายเดือนก่อน +1

    who knows how we can make a loops in the templates. for example i have a list of orders for each customer and in the template i want to loop through the list of orders and add each order to the file, and each customer has different list length so i want to make loop to make it more dynamic.
    i mean i want the loop to be within the template not in the code.

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

    I broke python by deleting a folder, I reinstalled it and nothing I do works, the folder I deleted was something like mingw/mingw62/lib/python 3.10 and now none of my python installations work and I just get the error: No module named 'encodings' when I try to run python.

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

    can you make a video for controlling/automating power bi dashboards

  • @iaconst4.0
    @iaconst4.0 10 หลายเดือนก่อน +1

    Ese codigo falla a veces, es muy inestable , no reemplaza muchas veces.

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

    Thanks

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

    This is great

  • @vasukansal1834
    @vasukansal1834 ปีที่แล้ว +3

    please explain every line in a more easy way for those people who are using such modules first time

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

    I ve used this at work haha

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

    Hello,
    Im just trying to start with python,
    I have question:
    what is that environment your coding in?
    Can you go thru code like in VBA when you can execute line by line with f8?

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

      I'll let the author say for certain which editor he is using. However, it looks like JetBrains PyCharm IDE to me. Another highly used IDE is MS Visual Studio Code. Either should work for you.

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

    interesting! thanks for this. new subscriber here! can you create content on creating python script to display computer name, cpuinfo , including users and their associated groups as well as status of services being run in the linux machine? :) Thanks!

  • @Biokompott
    @Biokompott 11 หลายเดือนก่อน +2

    thank you, but I think, word has something built-in for this.

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

    Comments on word file

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

    First comment and this seems like a good video.

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

    Thx_.

  • @mrbusiness8648
    @mrbusiness8648 9 หลายเดือนก่อน

    Hero