Remoing lines of text from a text file using powershell.
Posted on 2011-09-27
I am currently using this code to remove lines of text from a text file in a batch file and it works fine.
net use M: "\\Goldfinch\data"
move DEB304INV.txt L:
move DEB304FIN.txt L:
move DEB304REM.txt L:
more +29 "L:\DEB304REM.txt" > "L:\DEBTORS304REM.txt"
more +29 "L:\DEB304INV.txt" > "L:\DEBTORS304INV.txt"
ren DEB304FIN.txt DEBTORS304FIN.txt
net use M: /delete /y
I am moving all my batch files across to PowerShell, can you tell how to remove the lines out of the text file using PowerShell.