File: convdates.pl

package info (click to toggle)
bsdmainutils 4.7.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 796 kB
  • ctags: 463
  • sloc: ansic: 5,899; sh: 145; makefile: 129; perl: 14
file content (24 lines) | stat: -rw-r--r-- 473 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl -w

use strict;

# Converts calendar data files from US-style dates (MM/DD 01/15) into
# human-readable dates (Jan 15) which everyone should be able to read
# without mental gymnastics.

my %monthhash = (
	'01','Jan',	'02','Feb',	'03','Mar',	'04','Apr',
	'05','May',	'06','Jun',	'07','Jul',	'08','Aug',
	'09','Sep',	'10','Oct',	'11','Nov',	'12','Dec'
);

my $month; 
my $day;
my $desc;

while(<>)
{
	s,^([0-9][0-9])[/\\ ](.*),$monthhash{$1} $2,;
	print;
}