DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting the correct .csv plugin when multiple are available.

Solved!
Go to solution

I'm having a problem selecting (through my script) a specific .csv plugin to load my data.

I am using a  Call FileDlgShow command:

Call FileDlgShow(DataReadPath, "Thermotron_CSV,*.csv|TDM Files,*.tdm|DAT Files,*.dat|All Files, *.*", "Data selection", True)

 

When I execute this command, I recall a plugin format that is not the “Thermotron.CSV”.

It looks like it is using a different plugin.

Any Ideas?   

0 Kudos
Message 1 of 4
(3,325 Views)

The DataFileLoad command has a second parameter where you can specify your plugin.

Your Code should look like this:

Option Explicit

if "IDOk" = FileDlgShow(DataReadPath, "Thermotron_CSV,*.csv|TDM Files,*.tdm|DAT Files,*.dat|All Files, *.*", "Data selection", True) then
  For iCount = 0 To Ubound(FileDlgNameList)
    Call DataFileLoad(FileDlgNameList(iCount), "Thermotron_CSV")
  Next
end if

 

 

0 Kudos
Message 2 of 4
(3,299 Views)
Solution
Accepted by topic author SDuff

I have seen that you had multiple filters.

The following code can be used for this. There is also the ability to figure out the selected filter.

 

Option Explicit

if "IDOk" = FileNameGet("ANY", "FileRead", DataReadPath, "Thermotron_CSV,*.csv,TDM Files,*.tdm,DAT Files,*.dat,All Files, *.*", "All.lst", True, "Data selection") then
  Dim MyFileNames : MyFileNames = Split(FileDlgFileName,"|")
  dim filePath : For each filepath in MyFileNames
    select case UCASE(FileDlgExt)
      case ".TDM" Call DataFileLoad(filePath, "TDM")
      case ".DAT" Call DataFileLoad(filePath , "DAT")
      case ".CSV" Call DataFileLoad(filePath, "Thermotron_CSV")
      Case Else DataFileLoad(filePath)
    end select
  Next
end if
0 Kudos
Message 3 of 4
(3,290 Views)
Solution
Accepted by topic author SDuff

This is perfect. Thank you so much again for your help !!!  

0 Kudos
Message 4 of 4
(3,279 Views)