Looking For Example: Txt Import, Manipulate, Export

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MrBill
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3
Joined: Fri Mar 26, 2010 8:51 pm

Looking For Example: Txt Import, Manipulate, Export

Post by MrBill » Fri Mar 26, 2010 8:57 pm

Hello- I'm an UBBER NEWBIE to RR and programing so be kind :D

Instead of asking a bunch of how to's I'm going to ask a 'where's an example' question.

I'm looking to build a little application that imports data that was exported from excel in cvs (txt) format, manipulate it in RR, and export the results back out in the form of cvs (txt). I could always do this in XML, but I'm not experienced in XML so I'm a bit nervous about doing this.

Any examples of a csv import/export application? I need to learn how to import, store, manipulate, and export. To me, this seems monstrous but to many of you, this is probably a breeze.

Thanks! Looking forward to getting to know RR.

Mr. Bill :o

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: Looking For Example: Txt Import, Manipulate, Export

Post by RRobert » Fri Mar 26, 2010 9:20 pm

You could put a file into a field or variable by using the put command.

Code: Select all

put URL ("file:/Users/Example/Desktop/example.csv") into field "Field"
Manipulate it with replace for example.

Code: Select all

replace comma with tab in field "Field"
And also save it with the put.

Code: Select all

put field "Field" into URL ("file:/Users/Example/Desktop/example.csv")
Look for put, char, chunk, word, item, line, replaceText, replace, matchText, ... in the Dictionary or User Guide.

See also How do I rename the headers on a text file? and How do I export a csv file?

Robert

MrBill
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3
Joined: Fri Mar 26, 2010 8:51 pm

Re: Looking For Example: Txt Import, Manipulate, Export

Post by MrBill » Fri Mar 26, 2010 9:51 pm

Hey- Thanks Robert. This helps me know what to look for.

I also just found this example as well:
http://lessons.runrev.com/spaces/lesson ... ble-Field-

Now I need to figure out how to get the individual pieces of data into a grid like structure, mathematically manipulate it (functions), and export it it back out... Let the learning begin.

Thanks for the help!
- Mr. Bill

MrBill
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3
Joined: Fri Mar 26, 2010 8:51 pm

Re: Looking For Example: Txt Import, Manipulate, Export

Post by MrBill » Fri Mar 26, 2010 10:37 pm

Actually, on that note, I can't for the life of me find the Data Grid tool in the tool's palette. Does it not exist in Revolution Media 4.0 for Mac? Or maybe this is for RunRev Studio.

Is there a Data Grid Tool in Revolution Studio?

Thanks.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4027
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Looking For Example: Txt Import, Manipulate, Export

Post by bn » Fri Mar 26, 2010 10:43 pm

Bill,
no datagrid in RevMedia. RevStudio and up.
regards
Bernd
If you want to go for a table field have a look at http://revonline2.runrev.com/stack/428/ ... agDividers

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: Looking For Example: Txt Import, Manipulate, Export

Post by RRobert » Sat Mar 27, 2010 3:40 pm

But you could use a Table Field which is available in RevMedia and maybe sufficient.

Robert

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”