Forum Discussion

se2's avatar
se2
Helper II
5 years ago

Power BI , Word Files, and File Names

Can Power Bi do the following?

I have a large number of word documents (I also have them as Excel files but the formatting is better in Word).  The documents are named 1 misc.doc, 2 misc.doc ......     Each document has a title, in bold, at the very top of the document.  But most documents have some misc. text, in one or two rows before the title, a few words such as "Print" or "Tools".  I would like to remove these words, most importantly I would like to grab that title, in bold.   For simplicity, let's call the new title:  xTitle. Then rename or make a new file called 1 xTitle.doc  (or similar in excel).  The files do not have the same number of columns and a variety of different tables, etc.  Their only commonality is the bold title at the start of the document.

Thank you?

Steve

5 Replies

    • se2's avatar
      se2
      Helper II

      Thank you.  Would it be possible if my file were excel files or html files.  To clarify:

      1. I have two folders, one with excel files, one with html files.

      2. The files are uneven. While they have columns, they have different numbers of them, so these are not excel files that can be "merged."

      3. The files are named in a way that does not show their content.  This is the problem: 1 misc.xlsx ...

      4. Sometimes the 1st or 2nd rows contain a word or two that is irrelevant.

      5. By the 3rd row, there is a heading in bold.  I would like to be able to grab this and rename the file with that heading.  So 1 misc.xlsx becomes 1 MyHeading.xlsx

      6. Is is possible to write use dax or M to spool through the files and do the renaming or copying to new files with informative names?

      Steve

       

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        se2 While it *might* be possible, that is NOT a good use of Power Query, you should be doing that in a scripting language of some sort. I mean, if you were to do it, you would probably need R or Python steps I think. I'm really overall against this approach, I just think you need a better/different tool for this.

         

        ImkeF edhans do you agree? This leads down a rabbit hole of sadness and despair, right?