Search found 5868 matches
- 20 Oct 2016 04:05
- Forum: DOS Batch Forum
- Topic: FINDSTR woes with blank lines
- Replies: 13
- Views: 22681
Re: FINDSTR woes with blank lines
Purpose: To generate a script that runs through a folder full of large log files, pull out the last two error messages (as seen in example below) along with 50 lines of text before/after and place them in a new log file to be emailed or *something* later on. There are two native batch scripts that ...
- 20 Oct 2016 03:52
- Forum: DOS Batch Forum
- Topic: FINDSTR woes with blank lines
- Replies: 13
- Views: 22681
Re: FINDSTR woes with blank lines
your code doesn't even have FINDSTR in it. Apparently we are supposed to be omniscient. I bought my first bottle of omniscient tablets on ebay years ago. It began to be a regular need after seeing the questions being asked on batch file forums and I have my fix every day, without fail. I still can'...
- 20 Oct 2016 03:42
- Forum: DOS Batch Forum
- Topic: Conversion of batch to another language, then compile to an exe
- Replies: 8
- Views: 15495
Re: Conversion of batch to another language, then compile to an exe
In the same way that penpen discusses, batch files have so many undocumented techniques that a language conversion using autumated means is unlikely to be feasible.
- 20 Oct 2016 03:27
- Forum: DOS Batch Forum
- Topic: Ftp Script Multi account
- Replies: 1
- Views: 2711
Re: Ftp Script Multi account
I read your description but I skipped reading your code for now.
You have 700 ftp acounts on a server and you'd like to perform one task using all 700 accounts: is that right?
You have 700 ftp acounts on a server and you'd like to perform one task using all 700 accounts: is that right?
- 20 Oct 2016 03:21
- Forum: DOS Batch Forum
- Topic: How to assign group values from regexp to multiple external DOS batch variables?
- Replies: 4
- Views: 5115
Re: How to assign group values from regexp to multiple external DOS batch variables?
Did you blokes see any code where it says there should be some Assume I want to loop over a large directory tree with thousands of files. Only those files should be picked up for further processing which match a regular expression like (.*)\((.*).(.*)\).log logfile for variant 34 (223.101).log So a ...
- 20 Oct 2016 03:14
- Forum: DOS Batch Forum
- Topic: non gnuwin32 alternative to head?
- Replies: 5
- Views: 6650
Re: non gnuwin32 alternative to head?
batchcc wrote:Squashman wrote:taripo wrote:I want some alternatives to gnuwin32 head, and not a gnuwin32 alternative.
Well that is a head scratcher.
Ha great pun.
I chuckled too.
- 20 Oct 2016 03:12
- Forum: DOS Batch Forum
- Topic: weird error from gnuwin32 head, seems pipe related
- Replies: 10
- Views: 12098
Re: weird error from gnuwin32 head, seems pipe related
Thanks, that was very informative. In what programming language(s) have you had the experience of creating pipe objects? Was the environment *nix or windows, and were there big differences? I don't think he understood you penpen. His reply would have been more descriptive about his problem. My own ...
- 20 Oct 2016 02:56
- Forum: DOS Batch Forum
- Topic: Multi-line indentation
- Replies: 8
- Views: 7815
Re: Multi-line indentation
To get a better understanding of how the "scanner/lexer" works, I did some tests and managed to get some sort of GNU style indenting to work with the if command. if "%x%"^ == "%y%"^ ( echo Match found ) I am aware that there are a lot of drawbacks by doing this and it ...
- 20 Oct 2016 02:40
- Forum: DOS Batch Forum
- Topic: How to escape special characters in for-loop?
- Replies: 2
- Views: 5566
Re: How to escape special characters in for-loop?
It's likely you didn't get a reply because you were using a third-party tool and a complex 'for' expression and the whole task wasn't all that clear - as the output is showing foreign language characters. Non-latin characters are known poison characters and it just adds a layer of uncertainty to a q...
- 20 Oct 2016 02:28
- Forum: DOS Batch Forum
- Topic: %errorlevel% expansion within subroutine
- Replies: 6
- Views: 6654
Re: %errorlevel% expansion within subroutine
Okay, I guess I have overlooked things again . The directory existence check is necessary because the file has to be created even if the directory already exists, which was not the case in my previous code. The reason I need to know whether md succeeded is because the subroutine has to abort operat...
- 15 Oct 2016 06:35
- Forum: DOS Batch Forum
- Topic: %errorlevel% expansion within subroutine
- Replies: 6
- Views: 6654
Re: %errorlevel% expansion within subroutine
treintje wrote:It seems I have completely overlooked the fact that %errorlevel% was being expanded within the block of an IF statement.
At this point it would have been a good time to acknowledge the help you were given and say thank you.
- 15 Oct 2016 06:29
- Forum: DOS Batch Forum
- Topic: Multi-line indentation
- Replies: 8
- Views: 7815
Re: Multi-line indentation
treintje wrote:I still don't understand the ruling of the ^ anchor operator
It would help to know what you are actually doing with your code as the answers can be very different, and we end up wasting our time.
The caret is a line-continuation character, and also an escape character.
- 15 Oct 2016 06:24
- Forum: DOS Batch Forum
- Topic: FINDSTR woes with blank lines
- Replies: 13
- Views: 22681
Re: FINDSTR woes with blank lines
your code doesn't even have FINDSTR in it. Apparently we are supposed to be omniscient. I bought my first bottle of omniscient tablets on ebay years ago. It began to be a regular need after seeing the questions being asked on batch file forums and I have my fix every day, without fail. I still can'...
- 14 Oct 2016 13:21
- Forum: DOS Batch Forum
- Topic: FINDSTR woes with blank lines
- Replies: 13
- Views: 22681
Re: FINDSTR woes with blank lines
<"!file!" ( for /l %%i in (1 1 !startvar!) do set /p "=" for /l %%i in (%from% 1 %till%) do ( set "ln=" set /p "ln=" echo([%%i] !ln!)>> C:\Folders\Logs\Sum-%~1 REM SET /a count+=1 ) Where I run in to the problem is that the FINDSTR above ignores the lines wit...
- 14 Oct 2016 13:14
- Forum: DOS Batch Forum
- Topic: Splitting a variable string containing poisonous characters into parts (filename/path/etc)
- Replies: 6
- Views: 7071
Re: Splitting a variable string containing poisonous characters into parts (filename/path/etc)
Just a personal viewpoint about having percent characters in filenames etc. To me it is the most useless thing to try and handle in batch scripts and I use Total Commander to read an entire tree of files and then I use the multi-rename tool and replace every % with the word percent in one fell swoop...