Shell script to prepend text, date/time?

I'm looking for a way to prepend a string of text in a text file, including the current date/time. This is related to my earlier question about combining text file contents using shell scripts.
The text file to be acted upon would contain a simple chunk of text such as:
I want to prepend the following to the beginning of the file:
To result in
My research led me to the awk command, and I've tried some variations using the following base (which would only add the date/time, and not in the proper format, but that was my next step):
I was not able to get this to do anything at all. I tried replacing the $1 with a static file, with no luck either.
The full chain of events would be as follows:
1. .txt file is saved to a Dropbox folder
2. Hazel imports that entry to the Day One app, changes color label
3. Hazel prepends that entry with the current date & time, (## 2013-03-16 4:04 PM: ), using strftime and shell script (this is what I need help with)
4. Hazel then appends that modified content to a specific .txt file ("Master.txt")
The overall process will be to save .txt files to Dropbox (via Drafts app on iOS), import them as entries into Day One, then prepend with the hashtags and date/time, and add that modified entry to a master log file. The date/time info is redundant in Day One, hence the need for prepending. The plain text log file is just a backup document to avoid app lock-in. I am also updating that log file from other sources using IFTTT and such. Kind of like a Console.app for my life.
If easier, the initial text files are named with a date/time string in a slightly different format (2013-03-16 12-41 AM.txt) and could be used for the date/time prepending. That might even be more ideal since it will keep all the entries in sync.
The text file to be acted upon would contain a simple chunk of text such as:
- Code: Select all
Sample log file entry
I want to prepend the following to the beginning of the file:
- Code: Select all
## 2013-03-16 4:00 PM:
To result in
- Code: Select all
## 2013-03-16 4:00 PM: Sample log file entry
My research led me to the awk command, and I've tried some variations using the following base (which would only add the date/time, and not in the proper format, but that was my next step):
- Code: Select all
awk '{print strftime("%d/%m/%y",systime()) $0 }' < "$1"
I was not able to get this to do anything at all. I tried replacing the $1 with a static file, with no luck either.
The full chain of events would be as follows:
1. .txt file is saved to a Dropbox folder
2. Hazel imports that entry to the Day One app, changes color label
3. Hazel prepends that entry with the current date & time, (## 2013-03-16 4:04 PM: ), using strftime and shell script (this is what I need help with)
4. Hazel then appends that modified content to a specific .txt file ("Master.txt")
The overall process will be to save .txt files to Dropbox (via Drafts app on iOS), import them as entries into Day One, then prepend with the hashtags and date/time, and add that modified entry to a master log file. The date/time info is redundant in Day One, hence the need for prepending. The plain text log file is just a backup document to avoid app lock-in. I am also updating that log file from other sources using IFTTT and such. Kind of like a Console.app for my life.
If easier, the initial text files are named with a date/time string in a slightly different format (2013-03-16 12-41 AM.txt) and could be used for the date/time prepending. That might even be more ideal since it will keep all the entries in sync.