[nSLUG] How to sort data within a cell in Calc?

Joel Maxuel j.maxuel at gmail.com
Tue Jul 29 17:05:39 ADT 2014


Small modification (to include multi-digit numbers):

echo "1, 5, 14, 2, 3" | tr , "\n" | sort -n | tr "\n" , ; echo


--
Cheers,
Joel Maxuel

"One should strive to achieve, not sit in bitter regret."
 - Ronan Harris / Mark Jackson


On Tue, Jul 29, 2014 at 5:04 PM, Joel Maxuel <j.maxuel at gmail.com> wrote:

> Trina,
>
> I just played with something in bash, if you don't mind sorting one cell
> at a time (and copying & pasting between applications):
>
> echo "1, 5, 4, 2, 3" | tr , "\n" | sort | tr "\n" , ; echo
>
> Just enter that in your terminal emulator (with your string of numbers),
> and it will return the sorted version.
>
> Source:
>
> http://www.linuxquestions.org/questions/linux-general-1/bash-sort-string-separated-by-commas-916217/
>
>
> --
> Cheers,
> Joel Maxuel
>
> "One should strive to achieve, not sit in bitter regret."
>  - Ronan Harris / Mark Jackson
>
>
> On Tue, Jul 29, 2014 at 4:41 PM, Joel Maxuel <j.maxuel at gmail.com> wrote:
>
>> Sorry for the late post, but the discussion only verified what you are
>> trying to do.
>>
>> What you need is some Basic code (or the OpenOffice/LibreOffice
>> equivalent of VBA) to be able to sort the contents of an individual cell.
>>
>> Unfortunately I cannot think of any code that will easily do this (VBA or
>> Basic).  One could probably be whipped up, as you would create an array
>> that would take the values separated by the comma, sort, and then reinsert
>> (best you can get is probably in a different cell as it would be a formula,
>> and the came cell would only cause a circular reference) separated by that
>> comma.
>>
>> I've played with VBA before, but unfortunately only looked at Basic.  So
>> really I don't know where to start.
>>>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20140729/ee45f598/attachment.html>


More information about the nSLUG mailing list