Powershell script to insert new columns in excel

Welcome Forums General PowerShell Q&A Powershell script to insert new columns in excel

This topic contains 3 replies, has 4 voices, and was last updated by

 
Participant
3 months, 2 weeks ago.

  • Author
    Posts
  • #133029

    Participant
    Points: 11
    Rank: Member

    Hello,

    I have an excel sheet which has 10 rows and 200 columns, i want to add columns in between those 200 columns, below every column i want to add 5 new columns, its similar to insert new column if we choose a column a right click and click insert, how can i achieve this in powershell

  • #133050

    Participant
    Points: 343
    Helping Hand
    Rank: Contributor

    There are some Excel modules on PowerShell gallery.

    Find-Module -Name *excel*

    I have already used some of them but I don't remember which one is doing what.

    You must try them out...

  • #133097

    Moderator
    Points: 1,991
    Helping Hand
    Rank: Community Hero

    You can use the famous ImportExcel module to manage excel files in PowerShell. To add columns, Iterate through the object and add more entries then export it using Export-Excel cmdlet.

  • #133329

    Participant
    Points: 639
    Helping Hand
    Rank: Major Contributor

    You could also export it as a CSV and do the manipulation as a PSObject and export as CSV to avoid messing directly with Excel.

The topic ‘Powershell script to insert new columns in excel’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort