Hello,
Using Chilkat plugin for reading csv file i want to get a data from txt file as global … , with structure Etoile (Nom as string*10 ,Ad as double,Dec as double,Mag as double, visible as boolean.
Txt file (navstars.csv) contain 77 lines, each line contain data csv (5) as shown in structure (Etoile).
[code] Dim i As Integer
Dim Stable(77) as Etoile
'Load file containing star data.
// http://www.chilkatsoft.com/testData/sample.csv
Dim csv As New Chilkat.Csv
// Prior to loading the CSV file, indicate that the 1st row
// should be treated as column names:
csv.HasColumnNames = false
// Load the CSV records from the file:
Dim success As Boolean
success = csv.LoadFile(“C:\avFolder\avstars.csv”) // Folder where is stored a csv file
If (success <> True) Then
System.DebugLog(csv.LastErrorText)
Return
End If
// Display the contents of the 3rd column (i.e. the country names)
Dim row As Int32
Dim n As Int32
n = csv.NumRows
For row =0 To n-1
Stable(row).Nom = csv.GetCell(row,0)
Stable(row).Ad=cdbl(csv.GetCell(row,1))
Stable(row).Dec=cdbl(csv.GetCell(row,2))
Stable(row).Mag =cdbl(csv.GetCell(row,5))
next[/code]
I want to get those data from any method in the project, like :
For i=0 to Stable.Ubound
system.debugLog Stable(i).Nom + str(Stable(i).Ad) + str(Stable(i).Dec) + str(Stable(i).mag)
Next