load xls file to sql

  • So what problems are you having adding the additional steps?  Pretty simple to add a copy/move step to backup (archive) the file - and getting the count of rows in a CSV file is simply $csv.Count.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Backup of file:

    $date = get-date -uformat "_%d_%m_%Y_%H%M%S.bak"

    $newname=($csv -replace ".csv",$date)

    Rename-Item $csv $newname

    Count:

    $count=($csv).Count

    $count

    Can I just add this to the bottom of my script?

    Thanks.

  • Bruin wrote:

    Backup of file: $date = get-date -uformat "_%d_%m_%Y_%H%M%S.bak" $newname=($csv -replace ".csv",$date) Rename-Item $csv $newname

    Count: $count=($csv).Count $count

    Can I just add this to the bottom of my script?

    Thanks.

    Why not try and find out, rather than asking people here to do it for you?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply