Delimited Data

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Delimited Data

Post by Kaubs » Mon Jul 18, 2011 6:27 pm

I am trying to format returned text. I have sent off an array to a server and using the get command retrieve that data. The data at that point I can post to a field but I would like to format it into a more readable format. The data is delimited by a bar "|". Is there a way to "hit return after bar"? Is there a way to add a tab between two items that exist on the same line? The data will not be stagnant. Example of what returned data would look like... admin,10|ryan,7|username,5|testuser,2|adminiatrator,0|

Thanks for the help!
Kaubs

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Delimited Data

Post by Kaubs » Mon Jul 18, 2011 6:44 pm

Well...I figured out that I can issue a command to replace data...but formatting still seems a bit quirky.

I used "replace "|" with return" and that takes care of the next line operation...but since my text has a comma I would really like to separate any data after the comma to be right aligned...Can something like this be forced?

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Delimited Data

Post by Klaus » Mon Jul 18, 2011 6:56 pm

Hi Kaubs,
Kaubs wrote:Well...I figured out that I can issue a command to replace data...but formatting still seems a bit quirky.
Yep! Sad, but true!

"Normal" fields (includig the "pseudo" TABLE field) can only have ONE alignment: left center or right! And nothing else!
So the only way for you would be to use a DataGrid.
That can be set up to have different alignments in every column!
Kaubs wrote:I used "replace "|" with return" and that takes care of the next line operation...but since my text has a comma I would really like to separate any data after the comma to be right aligned...Can something like this be forced?
See above.
But you can additionally "replace COMMA with TAB" in YourData" to prepare the data for display in a DataGrid. 8)


Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Delimited Data

Post by FourthWorld » Mon Jul 18, 2011 8:07 pm

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Delimited Data

Post by Kaubs » Mon Jul 18, 2011 8:31 pm

kk....so I had the PHP guy change the commas out server side to be tab spaced for me..less thinking for the program I figured. Anyways... the data I'm working with is simple in that I only have 2 columns. The field itself I specified to shift the 2nd column 200px from the left using the tabstops function. The problem Im seeing now is that like 5 of my 8 results format properly and the other 3 seem to ignore the tabstops...Am I doing something wrong??

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Delimited Data

Post by Klaus » Mon Jul 18, 2011 10:08 pm

Hi Kaubs,

can't tell without looking at your script(s)! 8)

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Delimited Data

Post by Kaubs » Mon Jul 18, 2011 10:54 pm

Thanks for all your help guys! I was fighting an idiot move I made...for some reason some of the data moved and some of it didn't. The script is a 2 liner, gets the data from a url and then spits it in a field. The problem wasn't that the field wasn't working properly it was that I had moved from a lower res card to a higher res card in my mainstack. I had been trying to apply 200px tabstops to a card that needed 400px. Livecode was working perfectly and this is just another case of the program doing what I told it and me being blind to it. I found my fix by turning on the horizontal grid and vertical grid to find exactly where the text was separating. Sometimes you just need to step away and have some lunch lol.....

:P

Post Reply