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
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
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?
Summary: Is there any way to make yacc and lex (actually, bison and flex) parse in a more "context-directed" way? The language that I'm defining has a lot of entries in the flavor of: KEYWORD1 text ; KEYWORD2 ...
Summary: Hey everyone I need to know how to extract numbers from a text file. I'm a beginner with the for command and I'm not sure how to go about this. Basically this is what I have: I use the findstr comma...
Summary: I have never used VB, and I know Java has some methods to make this much faster, but assuming you have to do it all by yourself, you would get the string in the text box, take the first character, and...