Home Forums Programming Powershell How to copy last line of .txt file into new .txt file? RE: How to copy last line of .txt file into new .txt file?

  • Happy you got something going. I didn't mention tail.exe because it's not technically a PowerShell solution, but if you're open to using an external exe here is a sourceforge project I have used in the past (not in PowerShell, but when needing a peak in large files from the command line) to get head.exe and tail.exe ports for Windows:

    http://unxutils.sourceforge.net

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato