Windows command to Read text file from specific position -


i trying write first batch file, hence simple question: have file (say "myfile.txt") has names of 10 cities in different rows. want print these names on command prompt 1 one, constraint don't want first 2 letters of city names displayed, how can it?

i tried following code not seem work:

    /f "eol=: tokens=1" %%g in (myfile.txt) (     echo %%g:~2%     ) 

you need temporarily copy line variable, , substring of that. you'll want enabledelayedexpansion , change tokens * (for cities spaces in them). , turn echo off if want cities output.

@echo off setlocal enabledelayedexpansion  /f "eol=: tokens=*" %%g in (myfile.txt) (     set line=%%g     echo !line:~2! ) 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -