Search found 125 matches

by elzooilogico
13 Sep 2017 04:10
Forum: DOS Batch Forum
Topic: How to make multiple variable acceptable while whitelisting any other variable?
Replies: 2
Views: 1245

Re: How to make multiple variable acceptable while whitelisting any other variable?

Whenever you must evaluate two variables to boolean logic between them @echo off setlocal set /p var1="Val1, enter true or false: " set /p var2="Val2, enter true or false: " rem test AND if "%var1%"=="true" if "%var2%"=="true" ( echo/&e...
by elzooilogico
28 Aug 2017 05:58
Forum: DOS Batch Forum
Topic: Alignment using batchscript
Replies: 8
Views: 3970

Re: Alignment using batchscript

for the sake of speed... //>nul 2>nul||@goto :batch_code /* :batch_code @echo off rem place desired exe name set "theExeFile=myParser.exe" set "inputFile=.\input.txt" set "outputFile=.\output.txt" if not exist "%theExeFile%" call :build_the_exe || exit/B echo ...
by elzooilogico
21 Aug 2017 10:00
Forum: DOS Batch Forum
Topic: changing a 'Column' in a tab-delimited text File
Replies: 9
Views: 3377

Re: changing a 'Column' in a tab-delimited text File

Ok I noticed the problem with both of you codes, they don't allow for a empty/null column entry. Is there any way to fix this? Then, you need a workaround, @echo off SetLocal EnableExtensions EnableDelayedExpansion rem get sure here is the tab character (my text editor is set to change tabs into sp...
by elzooilogico
18 Aug 2017 02:44
Forum: DOS Batch Forum
Topic: changing a 'Column' in a tab-delimited text File
Replies: 9
Views: 3377

Re: changing a 'Column' in a tab-delimited text File

My fault, I didn't read carefully. I've seen a delimiter and assumed they were all the same. Then, this should do the job, as the only valid delimiter is tab.
by elzooilogico
17 Aug 2017 09:00
Forum: DOS Batch Forum
Topic: changing a 'Column' in a tab-delimited text File
Replies: 9
Views: 3377

Re: changing a 'Column' in a tab-delimited text File

I have a very large tab-delimited text file with 4 columns and many rows. I want a batch file to replace the third tab on each row with a colon. Here is an example of input and desired output: input(always 4 columns): username[tab]firstname[space]lastname[tab]email[tab]number username[tab]firstname...
by elzooilogico
16 Aug 2017 04:29
Forum: DOS Batch Forum
Topic: commands to change CmdPrompt buffer size?
Replies: 9
Views: 5313

Re: commands to change CmdPrompt buffer size?

Very impressive. I had to explore. I took your DOS powershell command out of context to try to understand this magic. your FOR construct seems to run %psCmd% in a way that hides the output. That consists of error messages about not being able to update the system variable $host. Yet the routine wor...
by elzooilogico
11 Aug 2017 04:39
Forum: DOS Batch Forum
Topic: commands to change CmdPrompt buffer size?
Replies: 9
Views: 5313

Re: commands to change CmdPrompt buffer size?

Don't know nothing about Win 10, but here (Win8) under HKEY_CURRENT_USER\Console key, you may find ScreenBufferSize 0x012c0050 WindowSize 0x00190050 Both are DWORD values, where hiword is lines and loword is columns. So ScreenBufferSize.Lines is 0x012c (decimal 300) and ScreenBufferSize.Columns is 0...
by elzooilogico
09 Aug 2017 04:02
Forum: DOS Batch Forum
Topic: Extracting substrings from strings
Replies: 4
Views: 2838

Re: Extracting substrings from strings

This should be enhanced (is slow) but does the work. @echo off SetLocal EnableExtensions EnableDelayedExpansion set "input=input.txt" set "output=output.txt" rem needed to show progress set/a cnt=0 for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E & echo on ...
by elzooilogico
02 Aug 2017 09:24
Forum: DOS Batch Forum
Topic: trim off some characters of lines in txt file
Replies: 5
Views: 2809

Re: trim off some characters of lines in txt file

echo !line:~6,16! can be call echo %%line:~6:16%% note double percent sign to force call evaluate the term inside. but performance will be worst than using delayed expansion (think about a large file to process) also, if performance is in your mind for ... do ( echo whatever>>somefile.txt ) will op...
by elzooilogico
29 Jul 2017 05:27
Forum: DOS Batch Forum
Topic: Batchscript to extract texts from multiple lines
Replies: 18
Views: 6030

Re: Batchscript to extract texts from multiple lines

This is a batch and c# hybrid script. If the c# exe is not found, the batch creates it. Else, simply call the c# exe with desired input and output filenames. Once the exe is created, you can make a simple call to it and remove all the useless stuff. The c# code is not the best approach as it process...
by elzooilogico
28 Jul 2017 05:15
Forum: DOS Batch Forum
Topic: Batch script - Multiple ip ping and output to mail
Replies: 1
Views: 1241

Re: Batch script - Multiple ip ping and output to mail

you're almost done @echo off set "fnm=C:\Batch\IPList.txt" set "lnm=C:\Batch\PingResults.txt" if not exist %fnm% ( echo. echo Cannot find %fnm% echo. Pause goto :eof ) >"%lnm%" ( echo PingTest STARTED on %date% at %time% echo ============================================...
by elzooilogico
28 Jul 2017 04:55
Forum: DOS Batch Forum
Topic: Batchscript to extract texts from multiple lines
Replies: 18
Views: 6030

Re: Batchscript to extract texts from multiple lines

@Antonio and @Dave, Wow your code is brilliant! But, please let me introduce a point. The sequence

Code: Select all

IGR------K
|||      |
IGRQRGIGRK

in your scripts, is parsed as (also using jrepl.bat)

Code: Select all

IGR
|||
IGR

K
|
K



May I missed something?