On 2021-05-23 2:20 p.m., Francesco Scaglioni wrote:

FName SName - Month D, yyyy  ( Then names and dates vary )

I wish to change these to :

yyyy-mm-dd - FName SName

As others point out, if all you want is to re-order fields then shell or AWK can do that, but it supposes that all the lines are in that format..

But converting "Jan 6, 2021" "to 2021-01-06" is another matter.

For that I'd recommend PERL. It has a module (q.v.) that can read dates in a wide variety of formats and again, print them in the a variety of formats.
Oh, and do arithmetic on them.


https://stackoverflow.com/questions/7486470/how-to-parse-a-string-into-a-datetime-object-in-perl

https://www.perlmonks.org/?node_id=1179258

There are many more articles on this at Stackoverflow and PerlMonks.
Google is your friend

--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice how restful it is to watch the cursor blink. Close your eyes.
The opinions stated above are yours. You cannot imagine why you ever felt 
otherwise.
____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to [email protected]

Reply via email to