Datagrid column of data with trailing spaces

Phil Davis revdev at pdslabs.net
Mon Jul 14 17:30:56 EDT 2014


Oops. I should read your problem description better before I try to 
solve it.

put the dgText of grp "dgTryAgain" into tText
split tText by column
repeat for each line tLine in tText[1]
     put word 1 to -1 of tLine & CR after tNewCol
end repeat
delete last char of tNewCol
put tNewCol into tText[1]
combine tText by column
set the dgText of grp "dgTryAgain" to tText

That should do it.
Phil


On 7/14/14, 2:21 PM, Phil Davis wrote:
> put the dgText of grp "dgGrid" into tText
> repeat for each line tLine in tText
>     put word 1 to -1 of tLine & CR after tNewText
> end repeat
> delete last char of tNewText
> set the dgText of grp "dgGrid" to tNewText
>
> :-)
> Phil Davis
>
>
> On 7/14/14, 1:56 PM, Magicgate Software - Skip Kimpel wrote:
>> Good afternoon,
>>
>> I have a datagrid and column 1 has trailing spaces in the data items 
>> that I
>> need to get rid of.  The number of trailing spaces is never
>> consistent.  Once again, I think regex will be my friend / worst 
>> enemy :)
>>
>> Suggestions on how to do this effectively?
>>
>> Thanks in advance for your input,
>>
>> SKIP
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>

-- 
Phil Davis





More information about the use-livecode mailing list