Author

Topic: Need perl program written [CLOSED] (Read 585 times)

legendary
Activity: 3472
Merit: 4801
December 30, 2014, 12:53:30 AM
#4
I managed to find the time to write the script myself this evening.  I no longer need someone to do this for me.  Locking topic.
legendary
Activity: 3472
Merit: 4801
December 29, 2014, 09:40:55 PM
#3
Would you mind sharing the purpose of this?

I need to repeatedly modify the date stamp in two locations in two formats in a 258 byte file on a regular basis.
legendary
Activity: 1260
Merit: 1000
World Class Cryptonaire
December 29, 2014, 09:17:21 PM
#2
Would you mind sharing the purpose of this?
legendary
Activity: 3472
Merit: 4801
December 29, 2014, 06:44:49 PM
#1
I need a perl script written quickly (preferably completed within 12 hours of my creating this post) and don't have the time to do it myself.  I suspect that any perl programmer with experience using pack and unpack as well as date manipulation will be able to create this in less than an hour.  Please contact me with an offer of how much you'd like to be paid to complete this task, and how soon you can provide the code.

When calling the perl script, it will be provided on the command line with a fully qualified path and filename.

The filename will be a 258 byte file of binary data.

The script will need to use the current system date to compute the date of the first day of the previous month. For description purposes, I'll call this startDate. (As an example, if the script were run today then the startDate would be November 1, 2014)

The script will need to use the current system date to compute the date of the last day of the previous month. For description purposes, I'll call this endDate. (As an example, if the script were run today then the endDate would be November 30, 2014)

The script will need to convert the startDate into an integer representing the number of days since December 31, 1979 (so January 1, 1980 would be an integer value of 1, and today December 30, 2014 would be an integer value of 12783). For description purposes, I'll call this intStartDate

The script will need to convert the endDate into an integer representing the number of days since December 31, 1979 (so January 1, 1980 would be an integer value of 1, and today December 30, 2014 would be an integer value of 12783). For description purposes, I'll call this intEndDate

The script will need to replace bytes 104 through 111 with the ascii representation of the startDate in the format of MM/DD/YY

The script will need to replace bytes 113 through 120 with the ascii representation of the endDate in the format of MM/DD/YY

The script will need to replace bytes 153 and 154 with the 2 byte integer value of intStartDate (in the case of a startDate of 2014-11-01 byte 153 would be 0xB4 and byte 154 would be 0x31)

The script will need to replace bytes 155 and 156 with the 2 byte integer value of intEndDate (in the case of an endDate of 2014-11-30 byte 155 would be 0xD1 and byte 156 would be 0x31)
Jump to: