Remove last 2 characters from each line....

November 5, 2009 at 05:01:09
Specs: Windows XP
I have a large file of text, with exactly 34 characters on each line.
I want to run a batch to remove the last 2 characters of each line so that I have 32 characters on each line.

Been trying to do this for ages without success!


See More: Remove last 2 characters from each line....

Report •


#1
November 5, 2009 at 05:55:50
@echo off & setlocal EnableDelayedExpansion > "fileOUT.txt"
for /F "delims=" %%j in ('type "FileIN.txt"') do (
  set line=%%j
  echo.!line:~0,-2!>> "fileOUT.txt
)
:: End_OF_Batch


Report •

#2
November 5, 2009 at 06:23:10
Legend, thanks very much

Report •

Related Solutions


Ask Question