WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: nickedw on November 30, 2013, 07:50:10 PM

Title: csv array date formats
Post by: nickedw on November 30, 2013, 07:50:10 PM
I have several date columns which are included in a csvarray export.
One date column is formatted as " yyyymm" eg 201311
Another date column is formatted as yyyy-mm-dd eg 2013-11-30
After doing a csvarray export these date columns has the format mm/dd/yyyy eg 11/30/2013
here is an excerpt from the csv array output:
"(11/30/2013","145814.0","11/5/2013","11/5/2013",....
Is there a way to tell Winbatch to keep the excel format, or format using Winbatch?

Thanks for all help
Title: Re: csv array date formats
Post by: stanl on December 01, 2013, 04:55:00 AM
I discovered over time that when converting custom Excel formats to flat files the clipboard works best, or use Excel's XML functions. With the clipboard you get TAB-delimited not csv, but that can be worked around.
Title: Re: csv array date formats
Post by: DAG_P6 on December 02, 2013, 05:42:11 PM
The Excel export to CSV converts dates to the Short Date format set in the Windows Control Panrel, which is usually mm/dd/yy or mm/dd/yyyy.

With respect to the clipboard giving you TAB delimited records, that should be just dandy for WinBatch, since the default list delimiter happens to be at TAB. However, if I intend to do much with the contents of such a list, I usually convert it into an array. The initial conversion is fairly quick, and required but one statement. Once cinverted, array operations are very fast and efficient.

On the other hand, I am not very fond of XML, because the format is bloated and computationally expensive to process.
Title: Re: csv array date formats
Post by: td on December 03, 2013, 06:38:57 AM
Quote from: DAG_P6 on December 02, 2013, 05:42:11 PM
On the other hand, I am not very fond of XML, because the format is bloated and computationally expensive to process.

Not at the top of my list of favorite standardizations either.