Importing CSV file contents into DataGrid
Posted: Tue Oct 31, 2017 11:26 am
Hi Guys
Got this code that I want to use to import the contents of into a data grid:
Se attached images.
Any pointers would be appreciated.
Peter G
Got this code that I want to use to import the contents of into a data grid:
While tracing the code I get no errors and it puts the contents in the text field as well as replacing the "*" with a tab. But it does not put it in the datagrid.On ReadDataFile
answer file "Select a file"
put URL ("file:" & it ) into tFileContents
Put tFileContents into field "text" on Card "TrnHist"
put line 1 of tFileContents into tColumnTitles ## Creates Columns from the contents of the CSV's first line
replace comma with return in tColumnTitles
set the dgProp["columns"] of group "AppData" on Card "TrnHist" to tColumnTitles
delete line 1 of tFileContents
replace "*" with tab in tFileContents
Put tFileContents into field "text" on Card "TrnHist"
set the dgText of group "AppData" on Card "TrnHist" to tFileContents
Se attached images.
Any pointers would be appreciated.
Peter G