Created
April 23, 2010 17:03
-
-
Save peplin/376806 to your computer and use it in GitHub Desktop.
Migrate from Klok to Timetrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Christopher Peplin | |
# chris.peplin@rhubarbtech.com | |
# | |
# A litte script to migrate from Klok to Timetrap. | |
# Use the "download all time entry data" option in Klok for each project you wish to convert | |
# to a timesheet in Timestop. The copy and paste (or by some other method) | |
# convert their HTML table to plain text, with the fields separated by tabs. | |
# | |
# This script will then take the plaintext as input and run "t in" and "t out" | |
# for each entry. | |
# | |
# $ ./klok-to-timtrap.sh <text dump from Klok> <destination timesheet in Timetrap> | |
KLOKDUMP=$1 | |
TIMESHEET=$2 | |
t switch $TIMESHEET | |
IFS=";"; | |
for ENTRY in `awk -F'\t' '{print "t in --at \"", $2, $3, "\"", "\"", $1, "\"", "&& t out --at \"", $2, $4, "\";"}' $KLOKDUMP` | |
do | |
echo $ENTRY | |
eval $ENTRY | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment