Extracting specific data from a card field

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
kurt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 21
Joined: Sat Apr 08, 2006 8:30 pm
Location: Connecticut, USA
Contact:

Extracting specific data from a card field

Post by kurt » Mon Jan 16, 2017 3:22 am

I wasn't sure where to post this query; hopefully this is the spot.

I need help in determining a method for extracting specific text from a card field. I take it it is more flexible to do this than to try and extract items (words) directly from a text file (i.e. read from file). Each word (item) in the kind of file I'm working with is separated by a ^.

I have to read from the beginning until character }, which [item] is then set as a new starting point. I then extract specific words (by item numbers) from the text thereafter until the following }. Each segment between } chars can be varying lengths. There can also be varying numbers of segments, depending on the text file imported. However, the words required are always the same item numbers after the latest }.

In case this isn't clear, here is a simplified example:

item^item^...item}^item^ITEM^...item}^item^ITEM^...item}^, etc.

I would need to extract only the words indicated by ITEM, in this case item 2 of each segment.

Previously, the app I designed to do this had only to work with text files with predictable segments all of the same length. In that case I could simply loop around until the file ended.

It's been a long time since I worked with Runrev- I mean LiveCode!
I'm sure there are better ways to do this sort of thing than I remember.

Any suggestions appreciated.

kurt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 21
Joined: Sat Apr 08, 2006 8:30 pm
Location: Connecticut, USA
Contact:

Re: Extracting specific data from a card field

Post by kurt » Mon Jan 16, 2017 3:02 pm

(Discussion of this topic has been active on the Livecode User Group Facebook page; no need to duplicate it here. Thank you)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”