DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

non US date string format

I have csv files (many) with time stamped data in the format ddmmyyyy (and yymmdd). I seem unable to tell Diadem what format to expect and it seems to assume the US format mmddyyyy is good enough!. Short of reformatting all my data time stamps can't I tell Diadem what to expect? (I can only find how to change the format used to display the date).
Thanks, BAS
0 Kudos
Message 1 of 7
(4,303 Views)
Hi BAS,

How are you loading these CSV files? Are you simply dragging them from the NAVIGATOR into the Data Portal, are you using the ASCII Import Wizard, or are you using a custom DataPlugin you are creating? In the last two cases you can specify the time format contained in the file as part of the overall configuration.

There is no way to configure the drag&drop behavior of the CSV file importer, though if you call it programmatically there are a few options. In general, though, the CSV file importer that is used when you simply drag&drop a *.csv file from the NAVIGATOR into the Data Portal does a good job of interpreting non-US date/time formats. It was created in Germany with Europeans in mind. Does your CSV file have the European-standard semicolon (";") delimiter or US-standard ("," or tab) delimiters? What is the decimal character in your data columns ("." or ",")? What is your date delimiting character ("-", "/", or ".")?

Feel free to send over a sample file for us to test here, I'm confident we can read them into DIAdem without you having to rewrite their date/time stamps.

Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 7
(4,289 Views)
Hi Brad,

Yes I have been dragging my CSV files from the navigator into the data portal as the Import wizard will not work on these files. See details of error below.

In my CSV files the data delimiter is "," with a date delimiter "-" white space and time delimiter ":" ie[dd/mm/yyyy hh:mm]

I have used the import wizard in the past but when using the ASCII import wizard my current CSV files (with either extension .csv or .txt) I get the error message below after selecting the file, then the wizard closes!

file 525 "C:\....\zz.csv","MB-OK", MsgTypeAlert",1,0,0,501,"WizReport" [OK]

I have attached a partial file sample.

Many thanks for your assistance
BAS

PS as the forum does not accept the extension .csv (!) I have changed it to .txt
0 Kudos
Message 3 of 7
(4,285 Views)
Hi BAS,

I went through the ASCII Import Wizard and created an STP file for your ASCII file, and it seems to work great for me. I'm using DIAdem 9.1 SP2, what version of DIAdem are you using? Try the attached STP file and see if it works on your end. I used the date/time string format "dd/mm/yyyy hh:nn" in the configuration dialog-- note that the minute character is "nn" and not "mm".

Alternatively, you could build your own DataPlugin to load these files, or you could create a VBScript which calls the CSV plugin and passes it parameters to use in decoding the ASCII file.

Let me know how the STP file works for you,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 4 of 7
(4,270 Views)
Hi Brad,

The STP file worked fine thanks. My only question now is how do I access the ASCII import wizard when loading a .csv data file? (If the extension is .txt all is fine).

Cheers,
Scott
0 Kudos
Message 5 of 7
(4,263 Views)
Hi Bas,

You have two possibilities to load a *.csv file with the ASCII import wizard.
Interactive way: right click on the CSV file in the DIAdem-NAVIGATOR, than choose "Open with" and "ASCII import". The ASCII import wizard launches.

Script way: follow the steps below.

' declare variables
ASCIIFile = ProgramDrv & "Demo\Dat\Example.csv"
ASCIIConfig = "Test.stp"
ASCIIDlgFlag = 0 ' non wizard dialog

' associate file to be imported and STP file
Call ASCIIASSOCSET(ASCIIFile, ASCIIConfig)

' load configuration
Call ASCIICONFIGLOAD(ASCIIConfig)
' load file
Call ASCIILOAD(ASCIIFile, ASCIIDlgFlag)
delete association
Call ASCIIASSOCDEL(ASCIIFile)

Greetings

Walter
0 Kudos
Message 6 of 7
(4,258 Views)
Thanks Brad and Walter.
Your help was greatly appreciated.
0 Kudos
Message 7 of 7
(4,242 Views)