Re: Adding a leading zero
Re: Adding a leading zero
- Subject: Re: Adding a leading zero
- From: <email@hidden>
- Date: Wed, 4 Apr 2007 22:36:27 +0200
- Thread-topic: Adding a leading zero
Michelle,
thanks for your answer. What I had in mind was piping it thru sed or something like that. The leading zero is only needed for dates 0-9. The month will always be three chacters and the year four digits, it is only the day that will vary
I have been playing with InDesign JavaScript and come up with a two step solution.
myString='Apr42007'
myString=myString.replace(/(\D+)(\d+)/, '$10$2');
myString=myString.replace(/(\D{3})(\d{6}$)/, '$1$2');
I am sure this can be done much more simple and elegant, but I don't know how to transfer it to a tool like sed.
Thanks
Gunno I
>I am using this line to extract the modification date of a file
>ls -lT /Users/gunno/Library/Preferences/Flexklockan.plist | awk '{print $6 $7 $9}'
>The result is Apr42007
>How can I add a leading zero to the day digit?
>Or is there another and better way to get the modiicaion date?
>(Don't want to use /Developer/Tools/GetFileInfo)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden