August 2005 - Posts

Parsing Date in a Batch File

Today I was trying to generate a filename based on the current date in a batch file. After doing some searching here is what I came up with:

@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @( 
	Set Month=%%A
	Set Day=%%B
	Set Year=%%C
)

@echo DAY = %Day%
@echo Month = %Month%
@echo Year = %Year%

This allows for me to format the date anyway I want. I didn't know that the /F command of the For loop could tokenize line output. Thats pretty cool, although there should be a little better string support for batch files.

Also posted on my new blog.

Matching Balanced Constructs with .NET Regular Expressions

I'm reposting some of my favorite posts on my new blog.

Matching Balance Constructs with .NET Regular Expressions is the first post to be reposted.

Posted by puzzlehacker | with no comments
Filed under: ,

Offically opening my new Community Server site

Finally I've got enough time to at least get a bare-bone Community Server site up and running. The blog and feed should be working properly now. Please let me know if any part of the site is not working properly for you.

I decided to create this blog so that I didn't have to feel guilty about posting non-technical stuff on my weblogs.asp.net blog. I still plan to primarily post technical stuff on this blog but I reserve the right to post whatever I like. I intend to re-post some of my better posts (if you have a post in mind please let me know) from my weblogs.asp.net blog on this blog.

For now I plan on cross-posting technical posts onto both blogs but if you are interested in other posts please update your feed to my new blog feed.

More Posts