Search found 36 matches
- 2023-Mar-22, 8:10 am
- Forum: Windows CMD Shell
- Topic: Use SED to extract part of a line?
- Replies: 8
- Views: 135
Re: Use SED to extract part of a line?
Nice solution :) Thanks. :) I know I said it was done, but I couldn't resist making a couple tweaks to the way it handles lists passed to it from a file manager. Previously, it simply counted the lines in the list file that was passed to it and defaulted to processing all the NZB files in the direc...
- 2023-Mar-22, 7:39 am
- Forum: Windows CMD Shell
- Topic: Ampersand and exclamation mark in concatenated variable
- Replies: 2
- Views: 251
Re: Ampersand and exclamation mark in concatenated variable
I was browsing the forum and saw your message. This should do what you want with any legal filename; @echo off set tracks= for /r %%i in (*.mp3) do ( set name="%%i" call :AddTrack ) c:\apps\foobar2000\foobar2000.exe /tag:GUESS:"%%TRACKNUMBER%%. %%TITLE%%":%%_FILENAME%% %tracks% g...
- 2023-Mar-20, 8:01 am
- Forum: Windows CMD Shell
- Topic: For loops: Is there any reason you HAVE to use different tokens?
- Replies: 1
- Views: 30
For loops: Is there any reason you HAVE to use different tokens?
The other day while looking for something else, I stumbled across a web page where a user stated that since some other characters can be used as tokens in a For loop, it was possible to create more than 26 nested loops. The thing is that, other than for readability, there doesn't seem to be any need...
- 2023-Mar-17, 4:57 am
- Forum: Windows CMD Shell
- Topic: Use SED to extract part of a line?
- Replies: 8
- Views: 135
Re: Use SED to extract part of a line?
Unless I find any bugs, I'm declaring my NZB fixer script done. I added progress updates to the title bar, displaying the number of the file being processed as well as how many headers within that file have been fixed. I added protections against poison characters in the filenames being Echoed to th...
- 2023-Mar-15, 3:28 am
- Forum: Windows CMD Shell
- Topic: Are there any scripts that DEPEND on NOT using Delayed Expansion?
- Replies: 6
- Views: 105
Re: Are there any scripts that DEPEND on NOT using Delayed Expansion?
If you think you might encounter a filename that contains an exclamation point, then disable it. Thankfully, most normal people don't put exclamation points in their filenames unless they're working with ROMs or something, so it's largely a non-issue. Sometimes I use exclamation points to cause tho...
- 2023-Mar-14, 8:15 am
- Forum: Windows CMD Shell
- Topic: Use SED to extract part of a line?
- Replies: 8
- Views: 135
Re: Use SED to extract part of a line?
No need to use external tools. Thank you for the reply. I actually found this solution (using quotes as a deliminator) through a Google search the other day, and finished my script. Well, "finished" in the sense that it works. Now I'm going to polish it and add some options. For those who...
- 2023-Mar-12, 11:07 pm
- Forum: Windows CMD Shell
- Topic: Use SED to extract part of a line?
- Replies: 8
- Views: 135
Re: Use SED to extract part of a line?
SED is a stream editor intended to modify a files contents rather than extracting values from it. OK. I thought that since it could be restricted to individual lines, it would be a good choice for extracting part of a specific line. if you want to use bash utilities, I would start by using head and...
- 2023-Mar-12, 11:35 am
- Forum: Windows CMD Shell
- Topic: Use SED to extract part of a line?
- Replies: 8
- Views: 135
Use SED to extract part of a line?
I know this isn't really a Windows CMD command question, but I'm not sure where else to post this. Every time I try to post a question to a site like Stack Exchange, I'm usually told I posted in the wrong section, or I just get directed to a post asking a similar, but not quite the same, question, w...
- 2023-Mar-09, 6:27 am
- Forum: Windows CMD Shell
- Topic: Are there any scripts that DEPEND on NOT using Delayed Expansion?
- Replies: 6
- Views: 105
Re: Are there any scripts that DEPEND on NOT using Delayed Expansion?
The only time you really need to disable delayed expansion is when you're working with filenames that contain exclamation points. Yes, but since you never know ahead of time whether a filename will contain an exclamation point, leaving Delayed Expansion on all the time can cause any script that dea...
- 2023-Mar-07, 2:56 am
- Forum: Windows CMD Shell
- Topic: Are there any scripts that DEPEND on NOT using Delayed Expansion?
- Replies: 6
- Views: 105
Are there any scripts that DEPEND on NOT using Delayed Expansion?
Just a theoretical question... I'm given to understand that Windows batch scripts don't use Delayed Expansion in order to maintain backwards compatibility with older scripts, which didn't have it. As a result, inside loops, or when inside parenthesis, only the existing value of a variable can be rea...