Hi everyone,
I was a revolution studio developer, i havent touch runrev for 4 years, now its livecode and it seems quite the same.
to begin I have a work to make on livecode now, its easy to do but i have my first problems...
I want a software that import a file as input (xls file) and then export a file (.xls) which contains only few informations from the orignal file (filters)
i have put that file as attachement, i want to extract the column "reference de la commande" and the column "montant d'origine", with only the values filtered by : reference de la commande does not begin with "REF" and contains at least 14 characters.
To make it, I imported the file in a field in livecode, but when i try to access the column "reference de la commande" doing : " the item 4 of line 1 of field "myfield" it doesnt work, i have put the itemdelimiter to " ".
If you wanna understand easier what i am saying you should try.
It will be greatful to show me how you manage that little software, it will be a first step for me to remember me this good software and to progress faster.
Thanks all
import/export xls file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
import/export xls file
- Attachments
-
- file.zip
- (15.67 KiB) Downloaded 374 times
Re: import/export xls file
Hi Tal,
Livecode cannot use XLS files out of the box, since this is a proprietary file format!
Two possible solutions:
1. In EXCEL export the data in CSV or TAB delimited text format, which you can use immediately in Livecode
or
2. you need a 3rd party lib for Livecode, this one:
http://curryk.com/Spreadlib02001.zip
But I think the full version is not free!
Hope that helps!
Best
Klaus
Livecode cannot use XLS files out of the box, since this is a proprietary file format!
Two possible solutions:
1. In EXCEL export the data in CSV or TAB delimited text format, which you can use immediately in Livecode
or
2. you need a 3rd party lib for Livecode, this one:
http://curryk.com/Spreadlib02001.zip
But I think the full version is not free!
Hope that helps!
Best
Klaus
Re: import/export xls file
Ill check it tomorrow, can you remind me what is the command to allow the user to open a file to import?
And is there a function or a library in livecode to convert a pdf file into text, so i can manipulate the datas.
Thanks
And is there a function or a library in livecode to convert a pdf file into text, so i can manipulate the datas.
Thanks
Re: import/export xls file
Hi Tal,

Maybe there are some command line tools that you can use with SHELL()?
Sorry no idea...
Best
Klaus
P.S.
Ah:
...
answer file "Select a file:" with type "Livecode|livecode,rev,mc|"
put IT into tSelectedFile
## Do whatever you line with tSelectedFile
...

Yestal wrote:Ill check it tomorrow, can you remind me what is the command to allow the user to open a file to import?

Nope, also not out of the box!tal wrote:And is there a function or a library in livecode to convert a pdf file into text, so i can manipulate the datas.
Maybe there are some command line tools that you can use with SHELL()?
Sorry no idea...
Best
Klaus
P.S.
Ah:
...
answer file "Select a file:" with type "Livecode|livecode,rev,mc|"
put IT into tSelectedFile
## Do whatever you line with tSelectedFile
...

Re: import/export xls file
Export your data as a tab-delimited file, then read it into LiveCode.
Then you can either work with it as a text file, put your data into an array or put it into a Datagrid. Whatever you feel most comfortable doing. It will not be a difficult task.
Code: Select all
put URL ("file:" & tFileName) into myData
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/