Search found 15 matches
- 30 Sep 2016 10:46
- Forum: DOS Batch Forum
- Topic: find multiple strings with findstr and output to a text file
- Replies: 6
- Views: 12885
Re: find multiple strings with findstr and output to a text file
Will this help? For /F "Tokens=6 Delims=+" %%a In ('FindStr/BC:"UNB" D:\atemp\test.txt') Do ( Set "hard=%%a") ( For /F "Tokens=3 Delims=+" %%b In ('FindStr/BC:"BGM" D:\atemp\test.txt' ) Do Echo=%hard% %%b)>>D:\atemp\output.txt Thanks Compo! That wor...
- 21 Sep 2016 08:26
- Forum: DOS Batch Forum
- Topic: find multiple strings with findstr and output to a text file
- Replies: 6
- Views: 12885
Re: find multiple strings with findstr and output to a text file
I'm trying to do something similar to the above . I want to pull a string , where the line begins with UNB ,from any line in a specific file * There should on be on instance of this in the file*** I also would like to pull another string , where the line begins with BGM ,from any line in a specific ...
- 23 Aug 2013 03:33
- Forum: DOS Batch Forum
- Topic: need to only select the time of the oldest file
- Replies: 1
- Views: 2567
need to only select the time of the oldest file
The script is doing everything i want to but it is not picking the first/oldest file from the folder P:\Gensrvnt\workdir\CUSTDCHECK\ echo on cd.. cd workdir\CUSTDCHECK IF NOT EXIST P:\Gensrvnt\workdir\CUSTDCHECK\o_100_00000000* GOTO end REM GET CURRENT TIME(MINUTES only!!) set mm=%time:~3,-6% REM ge...
- 22 Aug 2013 08:32
- Forum: DOS Batch Forum
- Topic: For loop runs in command prompt screen but not in cmd file??
- Replies: 5
- Views: 4446
Re: For loop runs in command prompt screen but not in cmd fi
for %%a in (*.*) do set FileDate=%%~ta How do I just get the oldest file in the folder and only use that time. (Squeezeman) - I have read for/? and nothing jumps out at me that can carry this out. There is nothing in the FIND command that does it by oldest file either which was another thought Ther...
- 08 Aug 2013 09:41
- Forum: DOS Batch Forum
- Topic: For loop runs in command prompt screen but not in cmd file??
- Replies: 5
- Views: 4446
Re: For loop runs in command prompt screen but not in cmd fi
foxidrive wrote:use for %%a in (*.*) do set FileDate=%%~ta
Foxi to the rescue (as always)
thanks again kind sir
- 08 Aug 2013 08:17
- Forum: DOS Batch Forum
- Topic: For loop runs in command prompt screen but not in cmd file??
- Replies: 5
- Views: 4446
For loop runs in command prompt screen but not in cmd file??
When I open a command prompt window and run each of the lines it does exactly what I want it to do. -Variable(mm) assigned to current time minutes -Variable (ff)assigned to File time minutes - Variable(cc) assigned to current time minutes minus File time Minutes -If CC is greater than 10 then I have...
- 07 Aug 2013 05:01
- Forum: DOS Batch Forum
- Topic: get last month, set it as a variable and insert in script
- Replies: 16
- Views: 17977
Re: get last month, set it as a variable and insert in scrip
penpen wrote:The problem is that the 08 (and 09) are no valid numbers as a leading 0 tells the interpreter to treat this as an octal value and 08 (and 09 are no valid octal numbers)
This may be fixed for example in this way:Code: Select all
set /a "bb=1%aa%-101"
penpen
Thanks Pen Pen
- 07 Aug 2013 03:27
- Forum: DOS Batch Forum
- Topic: get last month, set it as a variable and insert in script
- Replies: 16
- Views: 17977
Re: get last month, set it as a variable and insert in scrip
The script is in bold and has worked for several months. For some reason that I do not understand it is not running this month echo on set ff=%date:~6% set aa=%date:~3,-5% if %date:~3,-5%==01 set /a ff=%date:~6%-1 set /a bb=%aa%-1 if %bb%==1 set bb=01 if %bb%==2 set bb=02 if %bb%==3 set bb=03 if %bb...
- 30 Jul 2013 07:10
- Forum: DOS Batch Forum
- Topic: need an alert based files older than 30 minutes
- Replies: 2
- Views: 2780
Re: need an alert based files older than 30 minutes
foxidrive wrote:XXcopy from http://www.xxcopy.com has minute granularity.
Thanks foxi. I will have a look
- 30 Jul 2013 06:27
- Forum: DOS Batch Forum
- Topic: need an alert based files older than 30 minutes
- Replies: 2
- Views: 2780
need an alert based files older than 30 minutes
1.Need to check the date/time of the oldest files in a folder 2. If any of the the files are older than 30 minutes 3.move the files to a error folder Was looking at robocoy but that seems to be only able to move based on day robocopy D:DOS\TEST\ D:DOS\SUCCESS\ *.* /MINAGE:1 I need this set to 30 min...
- 21 Nov 2012 08:25
- Forum: DOS Batch Forum
- Topic: get last month, set it as a variable and insert in script
- Replies: 16
- Views: 17977
Re: get last month, set it as a variable and insert in scrip
Thanks Everyone that is working perfectly now
Really impressed.
Really impressed.
- 21 Nov 2012 08:24
- Forum: DOS Batch Forum
- Topic: get last month, set it as a variable and insert in script
- Replies: 16
- Views: 17977
Re: get last month, set it as a variable and insert in scrip
Thank Dave
I neglected to factor in the year
Much appreciated
I neglected to factor in the year
Much appreciated
dbenham wrote:What about Feb 2013
I assume #2012 refers to the year, so shouldn't that also get incremented at some point
I know Bowlardo didn't specify the requirement, but it seems like a problem to me. (easily fixed, I know)
Dave Benham
- 20 Nov 2012 10:42
- Forum: DOS Batch Forum
- Topic: get last month, set it as a variable and insert in script
- Replies: 16
- Views: 17977
get last month, set it as a variable and insert in script
my script is intended to run every month on the 1st day of the month and get all of last month's file containing a specific text. It is doing this perfectly at the moment. The only issue is that I will have to edit the month number highlighlighted below every month. need to get today's date extract ...
- 05 Jul 2012 10:08
- Forum: DOS Batch Forum
- Topic: Search© file containing specifc text to a certain path
- Replies: 2
- Views: 2903
Re: Search© file containing specifc text to a certain pa
Thanks Foxidrive. That worked perfectly.
Much appreciated
Much appreciated
- 28 Jun 2012 08:38
- Forum: DOS Batch Forum
- Topic: Search© file containing specifc text to a certain path
- Replies: 2
- Views: 2903
Search© file containing specifc text to a certain path
Search© file containing specifc text to a certain path (on a daily basis) I am searching the sub folders of the following path P:\Gent\IntIn\#2012\06\28 (P:\Gent\IntIn\#2012\06\>findstr /s /m "SDT=:034273901" *.* ) I am using the command findstr /s /m "SDT=:034273901" *....