Search found 197 matches

by Sponge Belly
12 May 2015 13:52
Forum: DOS Batch Forum
Topic: split string into substrings based on delimiter
Replies: 37
Views: 29227

Re: split string into substrings based on delimiter

Hi Antonio, Your last example was amazing. Too bad I can’t understand it! Anyways, I was wondering if it’s possible to change the value of the original string from inside the loop caused by the string split operation… because if it is, we could append to the string what was just taken off, the strin...
by Sponge Belly
02 May 2015 13:25
Forum: DOS Batch Forum
Topic: split string into substrings based on delimiter
Replies: 37
Views: 29227

Re: split string into substrings based on delimiter

Hi Aacini,

Clever use of delayed expansion and set /a! 8)

Your method of storing all the intermediary results was so obvious when I read the example… so why didn’t I think of it myself? :cry:

Anyways, I changed the subject line as you suggested.

Laters!

- SB
by Sponge Belly
02 May 2015 09:17
Forum: DOS Batch Forum
Topic: split string into substrings based on delimiter
Replies: 37
Views: 29227

split string into substrings based on delimiter

Hi All! The syntax for extracting the first occurrence of a substring to end of string is well known: set "tail=%str:*x=%" And there’s a kludgy way to get the start of a string up to the first occurrence of the substring: set "head=%str:x=" & rem."%" I was messing a...
by Sponge Belly
02 Apr 2015 07:18
Forum: DOS Batch Forum
Topic: OT: anyone with an active msn.com account?
Replies: 3
Views: 2203

Re: OT: anyone with an active msn.com account?

jwoegerbauer wrote: You simply use your Microsoft Account data ( username / password ) to login to MSN.com Ah, if it were only that simple… To be clear, I need an email address in the form of firstname.lastname@msn.com. Hotmail or outlook.com won’t do. I’m locked out of a social networking account. ...
by Sponge Belly
02 Apr 2015 04:04
Forum: DOS Batch Forum
Topic: OT: anyone with an active msn.com account?
Replies: 3
Views: 2203

OT: anyone with an active msn.com account?

Hi Guys, We’re a retro bunch, so I thought it might be worth a try to ask here… Does anyone here still have an active msn.com account? If you do, I’m hoping you could set up an email alias for me (eg, firstname.lastname@msn.com) so I can access a social networking account tied to the email address. ...
by Sponge Belly
19 Mar 2015 04:42
Forum: DOS Batch Forum
Topic: create dummy files of exact size
Replies: 15
Views: 7597

Re: create dummy files of exact size

Hi Ed,

Thanks for pointing that out. Apologies for my sloppy terminology. The error has been corrected.

- SB
by Sponge Belly
17 Mar 2015 16:34
Forum: DOS Batch Forum
Topic: create dummy files of exact size
Replies: 15
Views: 7597

Re: create dummy files of exact size

Me Again! And a festive St. Patrick’s Day to everyone! Antonio, your bit logic confounds me. Please explain what’s going on in your last post. It’s late and I’m tired and I’ve had a bit too much to drink. In the meantime, here’s another approach that exploits the more /t option: @echo off & setl...
by Sponge Belly
14 Feb 2015 11:53
Forum: DOS Batch Forum
Topic: eol=; tokens=*
Replies: 18
Views: 15507

Re: eol=; tokens=*

Hi Dave, And a happy St Valentine’s Day to you! Thanks for explaining Jeb’s string magic. I get it now. The truncation only occurs on the last iteration of the for /l loop. The syntax is ignored the rest of the time. Devious. You wrote: When FOR /F processes a line, it first breaks the line into tok...
by Sponge Belly
13 Feb 2015 16:30
Forum: DOS Batch Forum
Topic: eol=; tokens=*
Replies: 18
Views: 15507

Re: eol=; tokens=*

Thanks to everyone who replied. Apologies for not responding sooner. @npocmaka Imho, the priority of for /f options in most cases is: ⋅ usebackq ⋅ skip ⋅ delims ⋅ eol ⋅ tokens Skip will count blank lines and lines beginning with eol. Delims is next b...
by Sponge Belly
01 Feb 2015 11:46
Forum: DOS Batch Forum
Topic: getTimestamp.bat for time and date processing
Replies: 45
Views: 46944

Re: getTimestamp.bat for time and date processing

@Foxi

Did you really say “look a gift horse in the mouse”? :lol:

Turn off the computer and go out into the fresh air for a walk! :D

- SB
by Sponge Belly
10 Jan 2015 06:47
Forum: DOS Batch Forum
Topic: eol=; tokens=*
Replies: 18
Views: 15507

Re: eol=; tokens=*

Hello Again! Here’s some more for /f weirdness: @echo off & setlocal enableextensions disabledelayedexpansion if not exist "hash10k.txt" ( for /l %%I in (1 1 1000) do <nul set /p "=##########" >>"hash10k.txt" <nul set /p "=# " >>"hash10k.txt" ) i...
by Sponge Belly
02 Jan 2015 04:15
Forum: DOS Batch Forum
Topic: eol=; tokens=*
Replies: 18
Views: 15507

Re: eol=; tokens=*

Hi Foxi, Sorry for not being clearer. The difference in the output from your first two examples is, as you inferred, what I was trying to draw attention to. When "delims=" is in effect, lines beginning with a semi-colon will be ignored. But when it’s "tokens=*", lines where the f...
by Sponge Belly
01 Jan 2015 17:11
Forum: DOS Batch Forum
Topic: eol=; tokens=*
Replies: 18
Views: 15507

eol=; tokens=*

Happy 2015! Has anyone else noticed this strange behaviour? @echo off & setlocal enableextensions disabledelayedexpansion for /f "delims=:" %%N in ( 'findstr /bln __DATA__ "%~dpnx0" ') do set lino=%%N for /f "usebackq skip=%lino% eol=; tokens=*" %%A in ( "%~dpn...
by Sponge Belly
26 Dec 2014 15:23
Forum: DOS Batch Forum
Topic: reflections on jrepl and findrepl
Replies: 2
Views: 1397

reflections on jrepl and findrepl

Dear Dave and Aacini, First of all, let me say that jrepl and findrepl are excellent programs. Some may grumble that they are JavaScript wrapped in Batch, but I don’t think that’s a valid criticism because it would be simply impossible to write a program in “pure Batch” (whatever that is) that would...
by Sponge Belly
26 Dec 2014 14:23
Forum: DOS Batch Forum
Topic: All I Want for Christmas…
Replies: 3
Views: 1805

All I Want for Christmas…

Dear DosTippers, I have a complete set of 3.5inch floppies that came shrink-wrapped with an early 1990s Digital Equipment Corporation (DEC) PC. DEC later sold off their PC division to Compaq who were in turn swallowed up by HP. Anyways, the point is, I have the disks for MS-DOS 6.2 and Windows 3.1… ...