Date conversion

74 views
Skip to first unread message

RAJAPPA

unread,
Nov 3, 2016, 4:21:51 PM11/3/16
to csvfix
My data contains data in the format "20191102"
How can I convert them to
" 02/11/2016 "

neil butterworth

unread,
Nov 3, 2016, 4:43:41 PM11/3/16
to csv...@googlegroups.com
> How can I convert them to " 02/11/2016 "

Do you actually mean "02/11/2019"?


--
You received this message because you are subscribed to the Google Groups "csvfix" group.
To unsubscribe from this group and stop receiving emails from it, send an email to csvfix+unsubscribe@googlegroups.com.
To post to this group, send email to csv...@googlegroups.com.
Visit this group at https://groups.google.com/group/csvfix.
For more options, visit https://groups.google.com/d/optout.

RAJAPPA

unread,
Nov 4, 2016, 12:09:59 PM11/4/16
to csvfix
I am extremely sorry
Given value 20161102
To be formated 02/11/2016

Neil Butterworth

unread,
Nov 4, 2016, 12:19:30 PM11/4/16
to csvfix
[neilb@cordelia temp]$ cat d.csv
20161102

[neilb@cordelia temp]$ csvfix edit -e "s:\(....\)\(..\)\(..\):\3/\2/\1:" d.csv
"02/11/2016"

Also, you spammed this group with 14 copies of basically the same post - don't do that again, or you will be banned.

RAJAPPA

unread,
Nov 5, 2016, 1:42:55 PM11/5/16
to csvfix
Sorry sir
Thanks a lot
Which portion of the help file /topic should I read in order to write code like this in future

Neil Butterworth

unread,
Nov 5, 2016, 5:26:43 PM11/5/16
to csvfix
You need to read upon regular expressions - there is no tutorial material on these in the CSVfix manual.
Reply all
Reply to author
Forward
0 new messages