[Gllug] OpenOffice Calc date formats

Tim Schofield tim at scoffer.net
Fri Jun 26 12:45:18 UTC 2009


On Fri, 2009-06-26 at 11:35 +0100, lesleyb at herlug.org.uk wrote:

> I'll need to repeat this operation so I want to find a solution.
> I could do it nongraphically working solely on the csv file before it gets to
> Calc but I was wondering if anyone knows a date/time function that would convert 
> on the fly in Calc?

I have had a similar problem before and here is my nongraphically perl
one liner to reformat the date field.

perl -MDate::Manip -F, -l -a -n -e "@F[0]=&UnixDate(ParseDate(@F[0]),'%
d/%m/%Y');print join(',', at F)" test.csv 


@F[0] is because my date was in first column so change both occurrence
accordingly.

man Date::Manip for formats other than %d/%m/%Y.

My csv file did not have field headers and the fields were unquoted, so
you may need to sed -e 'd1;s/"//g' the file first.

Tim




-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list