03-31-2006 11:04 AM
04-03-2006 08:38 AM
Hi Travis
Do I understand correctly that you trying to import this data with the ASCII Import Wizard? If so, then there is an opportunity to pick "dot" or "comma" for your numeric data in the third step.
Greets,
Myrle
P.S. If you were to write a DataPlugin for this format then you could provide "." or "," as a File.Formatter.DecimalPoint.
04-03-2006 10:25 AM
04-04-2006 03:24 AM
Hello Travis,
I don't see a way to do exactly this with the ASCII Import Wizard but it should be fairly easy with a DataPlugin. You can check out the DataPlugin help at www.ni.com/dataplugins. The trick to this format is going to be to set the comma as a trim character. I was able to read this data:
alsdkjfasldkjg 123,567, 3458,876 890,123, 9723,876
Using this plugin:
Option Explicit Sub ReadStore (File) 'Tell the file how the string data is formed. File.Formatter.Delimiters = vbTab File.Formatter.LineFeeds = vbCrLf File.Formatter.DecimalPoint = "," File.Formatter.TrimCharacters = "," 'Move to the start of the data Call File.SkipLine() 'Create a file accessor Dim Block : Set Block = File.GetStringBlock() Dim i While Not IsEmpty(File.GetNextStringValue(eR64)) Call Block.Channels.Add ("FileData", eR64) Wend 'Provide the data to USI Dim ChannelGroup : Set ChannelGroup = Root.ChannelGroups.Add ("MyChannelGroup") Dim DirectAccessChannel For Each DirectAccessChannel In Block.Channels Call ChannelGroup.Channels.AddDirectAccessChannel (DirectAccessChannel) Next End Sub
I've attached the DataPlugin as a uri file too, to make it easier for you to install it and then adjust it for your specific needs.
Hope that helps,
Myrle
04-04-2006 03:36 AM
Hi Travis,
I recommend to you to forget about the comma as a delimiter character, use only the <tab>, then DIAdem will select your data with a comma at the end like “4,567,” but don’t worry about this, continue the ASCII Import Wizard process. On the next step be sure that you choose comma for the numeric channel format, then finish the process and DIAdem should import your data correctly, ignoring the comma at the end of your data, at least that works for me using DIAdem 9.1
Good luck,
Marc.
04-04-2006 07:11 AM
Myrle,
Thank you for the Plugin.
It imported all but the first row of data perfectly. I took a look at the code closer and commented out the "Call File.SkipLine()" and it works great now. The code is also a good start for me to learn about DataPlugins.
Thank you again.
Travis Briggs
04-04-2006 07:15 AM
Marc,
Thank you for your information on importing the data from Germany. This also worked well in DiaDem 10. I will give my colleague both your method and Myrle's. He will be very happy that he can load his data into DIADem to analysis it.
Thank you.
Travis Briggs