Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1680

SWITCH statement with regexes or wildcards as CASE expressions

$
0
0
Hi!

So I am writing, of all things, a batch file that creates a multipart MIME message body. Part of that is looking at a file name and determining its MIME type. The file name is given like so: pathandfile[:mime/type]. A few examples of valid filenames, some with MIME types, some without:
Code:
thatdir\userdata.yaml:text/yaml
thatdir\userdata.yaml
c:\cloudconfig\otherdir\configsamba.sh:text/x-shellscript
c:\cloudconfig\otherdir\configsumtin.sh
To extract the MIME type...

Read more

Viewing all articles
Browse latest Browse all 1680

Trending Articles