Search found 8 matches
- 11 Jun 2013 04:52
- Forum: DOS Batch Forum
- Topic: Bat - read from file and search if a line contain strings
- Replies: 10
- Views: 6272
Re: Bat - read from file and search if a line contain strin
hi, Thank you so much for the help. it is greatly appreciated. I'm posting below my solution (combination of different solutions): for /f "tokens=1,* delims=[]" %%a in (' find /n /v "" ^< "%LocalDir%\software_list.txt" ') do ( echo "%%b"|findstr /i /c:"Mi...
- 06 Jun 2013 04:59
- Forum: DOS Batch Forum
- Topic: Bat - read from file and search if a line contain strings
- Replies: 10
- Views: 6272
Re: Bat - read from file and search if a line contain strin
unfortunately, it is indeed
apologies for the troubles.
apologies for the troubles.
- 06 Jun 2013 00:57
- Forum: DOS Batch Forum
- Topic: Bat - read from file and search if a line contain strings
- Replies: 10
- Views: 6272
Re: Bat - read from file and search if a line contain strin
sure, What I'm actually trying to do is to read from a file (list.txt) and capture a line that matches with at least one of other 3 lines I already know, but doesn't match with specific another one. That's kind of done. I wan to capture the line I need (matches) in a global var as well as its line n...
- 05 Jun 2013 09:37
- Forum: DOS Batch Forum
- Topic: Bat - read from file and search if a line contain strings
- Replies: 10
- Views: 6272
Re: Bat - read from file and search if a line contain strin
ok, I think I managed to figure out part of the solution: @echo off set "found=" for /f "tokens=1,* delims=[]" %%a in (' find /n /v "" ^< "%LocalDir%\list.txt" ') do ( echo "%%b"|findstr /i /c:"one two small" /c:"one two birds" /c...
- 05 Jun 2013 05:26
- Forum: DOS Batch Forum
- Topic: Bat - read from file and search if a line contain strings
- Replies: 10
- Views: 6272
Re: Bat - read from file and search if a line contain strin
awesome... it works the only thing I cannot really figure out is how to set var1=%%b and var2=%%a, because I want to use them later. when I try to do this as follow: if defined found ( echo %%a found set var1=%%a set var2=%%b ) else ( echo %%a NOT FOUND ) nothing actually is stored in var1 and var2....
- 05 Jun 2013 01:07
- Forum: DOS Batch Forum
- Topic: Bat - read from file and search if a line contain strings
- Replies: 10
- Views: 6272
Bat - read from file and search if a line contain strings
hi guys, I'm trying to find a way to do the following: I'm reading from a file that has the following structure: "one two small flowers" "one two small red apples" "one two birds singing" "one two strings bla" I'm reading line by line and I want to find out if...
- 04 Jun 2013 04:39
- Forum: DOS Batch Forum
- Topic: Batch - Split directory name on folder parts?
- Replies: 4
- Views: 4045
Re: Batch - Split directory name on folder parts?
hi foxidrive,
Thank you so much for the suggestion. I think I can use it
as for the "Thank you in advance" - it has become more of a habit writing this down...
Have a lovely day,
Gerry
Thank you so much for the suggestion. I think I can use it
as for the "Thank you in advance" - it has become more of a habit writing this down...
Have a lovely day,
Gerry
- 04 Jun 2013 02:12
- Forum: DOS Batch Forum
- Topic: Batch - Split directory name on folder parts?
- Replies: 4
- Views: 4045
Batch - Split directory name on folder parts?
hi,
I need to split the following directory on its parts:
C:\folder1\folder2\folder3\folder4\ (I don't know in advance how long will the path be)
and to take folder4 and folder3 (the last two folders) in a variables.
Hope anyone can help me?
Thank you in advance,
Gerry
I need to split the following directory on its parts:
C:\folder1\folder2\folder3\folder4\ (I don't know in advance how long will the path be)
and to take folder4 and folder3 (the last two folders) in a variables.
Hope anyone can help me?
Thank you in advance,
Gerry