Search found 1609 matches

by Aacini
05 Jan 2019 12:32
Forum: DOS Batch Forum
Topic: Split text file at start marker and blank line or just start marker into multiple files
Replies: 9
Views: 1184

Re: Split text file at start marker and blank line or just start marker into multiple files

Simpler... @echo off setlocal EnableDelayedExpansion set "last=1" < Dialog.rc ( for /F "tokens=1,2 delims=: " %%a in ('(type Dialog.rc ^& echo 0 DIALOG^) ^| findstr /N /R /C:"^[0-9][0-9]* DIALOG"') do ( set /A "lines=%%a-last, last=%%a" if !lines! gtr 0 ( set /P "line=" for /L %%i in (2,1,!lines!) d...
by Aacini
30 Dec 2018 09:34
Forum: DOS Batch Forum
Topic: For /f processing delimited string
Replies: 4
Views: 748

Re: For /f processing delimited string

If you have the target string in a variable, and the substrings have not ? * wild-card characters, then you may use this simple trick:

Code: Select all

set "var=123?456?789"
for %A in ("%var:?=" "%") do echo %~A
Antonio
by Aacini
02 Dec 2018 10:41
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 814

Re: Parsing taking FOREVER - possible JSCRIPT solution?

I suggest you to also test my first code. You may get the time that both methods takes and post they (and also the time that your original code takes). IMHO this topic is about efficiency . Isn't it? So this point should take full attention (not just to get the correct result). I am very interested ...
by Aacini
02 Dec 2018 09:04
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 814

Re: Parsing taking FOREVER - possible JSCRIPT solution?

Another method that have not the restrictions of my previous one... @echo off setlocal EnableDelayedExpansion rem Extract desired values (for /F "tokens=2 delims=|" %%a in (FDRII_outline.txt) do ( set "value=%%~a" if "!value:~0,2!" equ "C-" echo !value! )) > out1.txt rem Sort desired values (this is...
by Aacini
02 Dec 2018 08:41
Forum: DOS Batch Forum
Topic: Parsing taking FOREVER - possible JSCRIPT solution?
Replies: 6
Views: 814

Re: Parsing taking FOREVER - possible JSCRIPT solution?

You have not given a single description of the desired values: How long they are? Contains they special characters? How many unique values could be expected in the 85K rows? All these points are needed in order to create an efficient solution. I invite you to carefully read the first post in this fo...
by Aacini
28 Nov 2018 07:09
Forum: DOS Batch Forum
Topic: How to I replace " by ' " (at the start and end of a string in a variable)? Doubling Backslashes?
Replies: 4
Views: 759

Re: How to I replace " by ' " (at the start and end of a string in a variable)? Doubling Backslashes?

Code: Select all

for /F %%a in (%myfile:\=\\%) do set "myfile='%%a'"
If the file name may contain spaces, just add "delims=" option to the FOR /F command.

Antonio
by Aacini
27 Nov 2018 18:15
Forum: DOS Batch Forum
Topic: License
Replies: 2
Views: 523

Re: License

I already said you this in a PM. At end of the first post in such a thread there is this phrase: Feel free to copy and use these programs in any way you wish. This phrase means that you don't need any type of license, or fee, or permission, or whichever to use, exploit, or do anything you want with ...
by Aacini
27 Nov 2018 15:26
Forum: DOS Batch Forum
Topic: Batch RPG: 004RPG (new) and HyperRPG (outdated)
Replies: 2
Views: 1299

Re: Batch RPG: 004RPG (new) and HyperRPG (outdated)

ShadowThief wrote:
27 Nov 2018 14:09
fireYtail wrote:
14 Dec 2017 09:20
Aren't you curious about why I named them that?
Not really, no.
This is the exact same answer I wanted to post! :wink:

Antonio
by Aacini
17 Nov 2018 19:09
Forum: DOS Batch Forum
Topic: HOW DO I MOVE DATA INTO SUB FOLDERS UPTO 4GB IN SIZE
Replies: 5
Views: 768

Re: HOW DO I MOVE DATA INTO SUB FOLDERS UPTO 4GB IN SIZE

@tweacle, Ok. This phrase means that you must locate the line that process the data inside the file and remove it. To know which line process the data inside the file, you may investigate what is the purpose of each line in this program (hint: the line you need to remove is the line before the one t...
by Aacini
16 Nov 2018 15:44
Forum: DOS Batch Forum
Topic: HOW DO I MOVE DATA INTO SUB FOLDERS UPTO 4GB IN SIZE
Replies: 5
Views: 768

Re: HOW DO I MOVE DATA INTO SUB FOLDERS UPTO 4GB IN SIZE

Here it is a possible solution. I removed the three last digits of the file size in order to perform operations with this number via SET /A command; I think this mod should not impact the result in any way. For my testings I create several text files and placed their sizes inside the files, so you m...
by Aacini
14 Nov 2018 11:14
Forum: DOS Batch Forum
Topic: Can I get access to an ascii character not in the standard set?
Replies: 37
Views: 7574

Re: Can I get access to an ascii character not in the standard set?

I did not know about passing a variable name to a function. Thanks for that revelation. In your last example: call :getParams "%string%" retVar You are passing the name of retVar variable to the function, isn't it? Sorry that I have not explained the final goal with a simple example. By "final goal...
by Aacini
14 Nov 2018 07:34
Forum: DOS Batch Forum
Topic: Can I get access to an ascii character not in the standard set?
Replies: 37
Views: 7574

Re: Can I get access to an ascii character not in the standard set?

I am afraid I don't understand your final goal... Do you want to evidence Batch file limitations or you want to solve your problem in a simple way? If you already have an intrinsically problematic string in a variable, why you expand it in a parameter? To show that this way don't works? :? Just pass...
by Aacini
13 Nov 2018 10:11
Forum: DOS Batch Forum
Topic: Can I get access to an ascii character not in the standard set?
Replies: 37
Views: 7574

Re: Can I get access to an ascii character not in the standard set?

You not said that you want to "enter odd number of quotes as parameters in the command line". You said that the data will be read from the console or from a file. The problem of get the command line parameters is solved as shown by aGerman in previous reply. And about splitting a string at colons th...
by Aacini
13 Nov 2018 08:32
Forum: DOS Batch Forum
Topic: Writing Batch code in an easier way with the aid of macros
Replies: 16
Views: 3673

Re: Writing Batch code in an easier way with the aid of macros

Yes. I explained this point in detail at this reply : . . . Suppose you have a macro-function that is usually executed this way: for /F "tokens=1-26" %%a in ("param1 param2 resultvar") do %macroFunc% How we may execute the macro in the following way? %macroFuncWithParams% param1 param2 resultvar Par...
by Aacini
11 Nov 2018 23:40
Forum: DOS Batch Forum
Topic: set/PBig: Input and output of bigger characters
Replies: 1
Views: 756

Re: set/PBig: Input and output of bigger characters

I developed a new version of this program that includes these features: Definition of more than one font that can be selected via a parameter. Management of lowercase letters. Input of a variable without a prompt. @echo off setlocal EnableDelayedExpansion rem set/PBig: Input and output of bigger cha...