I have over 5k text files in some folders. Now I need to only remove "-" from the first line and last line in each text file.
I dont know how to do it, is there anyone who can help? what should i use to do this? vbs or normal batch
OS: Windows7
text file like this: 01.txt
% 01-A247M15 G70
N0001 G30 G17 X-100 Y-100 Z0
N0002 G31 G90 X100 Y100 Z45
N0003 ; --PART NO.: NC-HON.PHX01.COVER-SHOE.DET-1000.050
N0004 ; --TOOL: 8.55 X .3937
N0005 D00 Q50 P01 +8.5500 ; TOOL DIA
N0006 D00 Q51 P01 +0.3920 ; TOOL RAD
N0007 % 01-A247M15 G70
Please help.
Use VBScript it’s simpler…
First you parse the text file into an array: http://www.windowsitpro.com/content/content/46489/Listing_01.txt
Then you do a REPLACE on the first and last row of the array and write it to another file, or the same file.