CSV'ed off
Posted: Wed Aug 28, 2019 8:59 am
As one does, I downloaded the output from an online linguistic data analysis program in .csv format . . .
I then imported the file into a Scrolling List Field like this:
working on the assumption (dangerous) that the default itemDelimiter was the comma (","), and
got thoroughly cheesed-off because, while the .csv data was imported it got chopped up in
an odd sort of way (see picture).
- -
For instance, line 1 of the data file contains the column headers
like this:
Key Item Type Publication Year Author
Now, as far as I can see that should all be imported into Line 1 of my field with commas something like this:
Key, Item Type, Publication Year, Author,
BUT what I got was something like this:
"Key","Item Type","Publication
Year","Author"
So, inevitable questions crop up:
1. What are all those double quotes doing there?
2. Why did LiveCode 'decide' to split line one in the middle of "Publication Year" ?
#2 is particularly problematic.
I then imported the file into a Scrolling List Field like this:
Code: Select all
on mouseUp
set the ink of me to srcCopy
answer file "Choose a TEXT file to import"
if the result = "cancel"
then exit mouseUp
else
set the text of fld "List1" to URL ("file:" & it)
end if
end mouseUp
got thoroughly cheesed-off because, while the .csv data was imported it got chopped up in
an odd sort of way (see picture).
- -
For instance, line 1 of the data file contains the column headers
like this:
Key Item Type Publication Year Author
Now, as far as I can see that should all be imported into Line 1 of my field with commas something like this:
Key, Item Type, Publication Year, Author,
BUT what I got was something like this:
"Key","Item Type","Publication
Year","Author"
So, inevitable questions crop up:
1. What are all those double quotes doing there?
2. Why did LiveCode 'decide' to split line one in the middle of "Publication Year" ?
#2 is particularly problematic.