• Thanks David,

    This is what i made based on several findings here and there.

    $inputFilename = "C:Temp20190924.TXT"
    
    $outstream = New-Object System.IO.StreamWriter "C:Temp20190624Output.txt"
    try {
    foreach ($line in [System.IO.File]::ReadLines($inputFilename)) {
    $outstream.WriteLine($line.Substring(9,2))
    }
    }
    finally {
    $outstream.Dispose()
    }
    
    
    

    It takes quite a while to finish.

    I will try your solution next and now you mention it, how can i add a progress bar to it?

    Thanks,

    Guus

  • Hi, Im relatively new to PowerShell but I have worked with Unix shell scripts for 10 years.

    2 questions:

    I have a 2GB text file with more than 23,000,000 lines. Is PowerShell able to handle such files?

    Second, I need column 18 thru 24 from this file. The file has a fixed width format.

    Without a doubt this can be done using PowerShell. Just don't know how.

    Thx for your time,

    Regards, Guus

     

  • Guus joined the group Group logo of PowerShellPowerShell 1 week ago

  • Guus became a registered member 1 week ago

  • Guus's profile was updated 1 week ago