shorten text by tab and char

Hewlett-packard ?
January 22, 2009 at 11:14:47
Specs: Windows XP, 2ghz 256
I am working on a .bat file that will copy images listed in a txt document to a new folder. The text document list the images as follows

001 1
002 0
003 1
004 1

how do i make it so it only use's the lines with 1 and then removes the tab and 1 from the name so it only sees

001
003
004

Please help Im stuck ;(

@echo off
mkdir Edit
for /f "tokens=*" %%w in ('type list.txt') do (
xcopy /f %%w.jpg  edit
)
pause


See More: shorten text by tab and char

Report •


#1
January 23, 2009 at 14:38:44
What about:

@echo off
mkdir Edit
for /f "tokens=1,2 delims=	 " %%w in (list.txt) do (
if %%x==1 xcopy /f %%w.jpg edit
)
pause

<untested>


Report •

#2
January 26, 2009 at 13:14:14
WOW THAT WAS GREAT THANK YOU here is my new code.

@echo off
mkdir Edit
for /f "tokens=1,2 delims=	 " %%w in (list.txt) do (
if %%x gtr 11.99  xcopy /f %%w.jpg edit
)
pause

only issue i have now is if my value is say 8.00 it is transferred. so if it wa listed as 08.00 it would be perfect however it is not ;( any idea on that one?


Report •

Related Solutions


Ask Question