Code: Select all
on ReadDataFile
answer file "Select a file"
put URL ("file:" & it ) into tFileContents
Put tFileContents into field "text" on Card "Database"
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 "Database" to tColumnTitles
delete line 1 of tFileContents
replace "," with tab in tFileContents
Put tFileContents into field "text" on Card "Database"
set the dgText of group "AppData" on Card "Database" to tFileContents
end ReadDataFile
I have tried using the same convention as video or photos paths - But nothing worked
put URL ("file:/Data/info.csv") into tFileContents
put URL ("file:Data/info.csv") into tFileContents
I know this is simple but it is driving me crazy...Help