Cynosure.X International LLC

: :

Add Comment | Related Links | TrackBack
Related Content

MonthToNumeric.sh (GPL)

MonthToNumeric.sh is a Bourne shell script that takes a three-letter month name and returns the numeric value of the month. The first character of the month name must be upper-case, while the rest of the character must be lower-case. If MonthToNumeric.sh does not recognize the month specified, it will return the value '99'.

MonthToNumeric.sh is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.

Usage

MonthToNumeric.sh [ -p ] "Month in Three Letters"

-p Pad leading zero.

Examples

: MonthToNumeric.sh Jan
1
: MonthToNumeric.sh -p Feb
02
: MonthToNumeric.sh -p nov
99
: MonthToNumeric.sh -p December
99
: MonthToNumeric.sh -p Wow
99

Attached File: MonthToNumeric.sh (1017 B)

Chieh Cheng
Tue, 04 Nov 2008 20:58:22 +0000

I have decided to make "MonthToNumeric.sh" more robust than before. The new version I attached below is now case-insensitive to your input. In addition, the month can be fully spelled out or limited to three characters as before.

This new version of the "MonthToNumeric.sh" script takes advantage of the following shell scripts, which are also available on this site. So to use the this script, you will need to download these other scripts if you don't already have them.

StrLen.sh
SubStr.sh

Usage

  MonthToNumeric.sh [ -p ] "Month in Three or More Letters"

-p Pad leading zero.

Examples

: MonthToNumeric.sh January
1
: MonthToNumeric.sh March
3
: MonthToNumeric.sh Apr
4
: MonthToNumeric.sh apr
4
: MonthToNumeric.sh aPr
4

Attached File: 1 - MonthToNumeric.sh (1 KB)

Chieh Cheng
Wed, 14 Apr 2010 01:29:04 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

Title: Number To Month String (GPL)
Weblog: Cynosure.X International
Excerpt: "NumericToMonth.sh" is a Bourne shell script that takes a number and returns the equivalent month as a string. If the number specified is not recognized as a month, then it will return the '???' string. "NumericToMonth.sh" is distributed as executable source code under the GNU General Public Lice . . .
Tracked: Tue, 13 Apr 2010 23:19:30 +0000

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 2 + 2?
Click button only once, please!

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

43 Users Online

Hacking Digital Cameras
Fun for Photographers



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.