Powershell to insert column name then fill with name of Excel workbook loop through folder? RRS feed

  • Question

  • So I wondered if this was feasible and need some hint to start.

    I have only found a couple examples that don't exactly fit.

    I also now have thousands of small files to add a column and then fill that will the name of the report (workbook.)

    All the files have exact structure and only one worksheet "Page 1".

    The reason I need to insert the report name is I will need this later to pivot the data and before I combined all the files.  I need to have the source of the data which is contained in the name.

    So from folder "C:User\Desktop\Test", for each .xls, open it (or not) Insert Column named "Type" in column L then fill in that column until A1 rows have no data (that is required field) but fill in with the workbook name only up to the "_" because after that is a serialized time stamp that doesn't matter for source.  Any help or hints appreciated.

    • Moved by Bill_Stewart Monday, April 30, 2018 9:32 PM Unanswerable drive-by question
    Monday, February 26, 2018 4:01 AM

All replies