Datagrid column of data with trailing spaces

Phil Davis revdev at pdslabs.net
Mon Jul 14 17:53:03 EDT 2014


Good deal! I'm sure Peter's solution works as well - I just don't know 
regex well enough to be effective with it.

Phil


On 7/14/14, 2:38 PM, Magicgate Software - Skip Kimpel wrote:
> Phil,
>
> That did it!  I had already started to test the previous code you sent and
> it wasn't working as expected. Your modified code works perfectly.
>
> Thank you!
>
> SKIP
>
>
> On Mon, Jul 14, 2014 at 5:30 PM, Phil Davis <revdev at pdslabs.net> wrote:
>
>> 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
>>
>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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