Computing.Net > Forums > Programming > delete first three characters from each line

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

delete first three characters from each line

Reply to Message Icon

Name: waster656
Date: November 3, 2009 at 04:10:11 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

I am trying to write a batch file that will delete the first three characters from every line of a text file with no success. I am a newbie to this, any help would be appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: November 3, 2009 at 04:44:16 Pacific
Reply:

@echo off > newfile & setLocal enableDELAYedexpansion

for /f "tokens=* delims= " %%a in (myfile) do (
set s=%%a
set s=!s:~3!
>> newfile echo.!s!
)


=====================================
Helping others achieve escape felicity

M2


0

Response Number 2
Name: klint
Date: November 3, 2009 at 05:28:07 Pacific
Reply:

What do you want the program to do when it encounters a line with less than three characters?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Unzip All the Zip files f... Replacing space tab with ...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: delete first three characters from each line

Remove last 2 characters from each line.... www.computing.net/answers/programming/remove-last-2-characters-from-each-line/20257.html

Batch file for renaming folders www.computing.net/answers/programming/batch-file-for-renaming-folders/15430.html

delete string in txt www.computing.net/answers/programming/delete-string-in-txt/16012.html