Computing.Net > Forums > Programming > shorten text by tab and char

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.

shorten text by tab and char

Reply to Message Icon

Name: hotcayle
Date: January 22, 2009 at 11:14:47 Pacific
OS: Windows XP
CPU/Ram: 2ghz 256
Product: Hewlett-packard / ?
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: January 23, 2009 at 14:38:44 Pacific
Reply:

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>


0

Response Number 2
Name: hotcayle
Date: January 26, 2009 at 13:14:14 Pacific
Reply:

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?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Batch File Conidtional menu batch he...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: shorten text by tab and char

lex and yacc advanced parsing www.computing.net/answers/programming/lex-and-yacc-advanced-parsing/13277.html

For and extracting nums from text www.computing.net/answers/programming/for-and-extracting-nums-from-text/11600.html

converting text to binary www.computing.net/answers/programming/converting-text-to-binary/4891.html