[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: removing commas from a cell in kspread
From:       Thomas Zander <zander () planescape ! com>
Date:       2002-06-20 11:14:34
[Download RAW message or body]

Simply doing this in the QRegexp  from the start seems a better solution 
to me...

A simple QString.replace(new QRegExp(","), ""); should do the trick :)


On Thu, Jun 20, 2002 at 12:56:20PM +0200, Nicolas Goutte wrote:
> Be careful! Sed can read and especially write from/to any arbitrary file. It 
> could be a security risk! (Trojan Horses)
> 
> Possible solutions:
> - check the command given to sed and forbid 'r' and 'w'
> - only allow certain commands (like 's')
> - implement only 's' as KSpread function (instead of sed, this could be 
> perhaps coded around QRegExp.)
> 
> Have a nice day/evening/night!
> 
> On Wednesday 19 June 2002 21:10, John Dailey wrote:
> > I think the SED function sounds like the best idea -- although then sed
> > becomes a dependancy of the system.  I don't know if that's a bad thing or
> > now.
> >
> > Anyway, if you check the return value from the system call you should be ok
> > in implementing it.
> >
> > -John
> >
> > On Tuesday 18 June 2002 03:22 am, Bo Thorsen wrote:
> > > On Monday 17 June 2002 00:25, John Dailey wrote:
> > > > On Saturday 15 June 2002 06:22 am, Rob Benton wrote:
> > > > > I've got a cell in kspread that contains numeric data 13 digits long.
> > > > >  But I don't want commas in it.  Is there a way to format it so that
> > > > > it reads like this:
> > > > > 3233112984432
> > > > > instead of this:
> > > > > 3,233,112,984,432
> > > >
> > > > No, there is not a way to do it -- but this looks like a good idea.
> > > > Please use bugs.kde.org to add a wishlist request for it.  I believe
> > > > this would take very little time to add so it almost certainly could be
> > > > done for the KOffice 1.2 release.
> > >
> > > Actually this made me think that it would be interesting to have pipes to
> > > sed in cells. Something like this:
> > >
> > > =D13+D14 | sed "s/,//"
> > >
> > > would solve this problem in a completely generic way instead of adding
> > > any number of adhoc solutions to parts of this problem.
> > >
> > > If you don't want to use the shell like approach to this (which would
> > > make the parser more, well, interesting) this would also be fine:
> > >
> > > =SED(D13+D14, "s/,//")
> > >
> > > If this sounds interesting, I might take a stab at implementing it
> > > myself. What do you think?
> > >
> > > Bo.
-- 
Thomas Zander                                           zander@planescape.com
                                                 We are what we pretend to be

[Attachment #3 (application/pgp-signature)]
____________________________________
koffice mailing list
koffice@mail.kde.org
To unsubscribe please visit:
http://mail.kde.org/mailman/listinfo/koffice

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic