FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-28-2012, 01:06 PM
lina
 
Default How to direct output into the LibreOffice Calc

Hi,

I wonder:

1]

can the output like:

5
3
1
5
3

direct it into the LibreOffice directly. without copy and paste.

2]

Is it possible to do a quick sum calculations for some output on terminal.

like the sum of

3
16
3
3
9


Thanks for your suggestions,


best regards,


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJm=tov1gkQwwkd+QCQTEhh88XAeH8=BTkVqDqfhHFycyr w@mail.gmail.com">http://lists.debian.org/CAG9cJm=tov1gkQwwkd+QCQTEhh88XAeH8=BTkVqDqfhHFycyr w@mail.gmail.com
 
Old 02-28-2012, 01:17 PM
Chris Bannister
 
Default How to direct output into the LibreOffice Calc

On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:
> Hi,

Hi,

> I wonder:

> 2]

Don't know about libreoffice, sorry.

> Is it possible to do a quick sum calculations for some output on terminal.
>
> like the sum of
>
> 3
> 16
> 3
> 3
> 9

root@tal:~# cat tt
4+6+7

root@tal:~# bc < tt
17

root@tal:~# man -k calculator
bc (1) - An arbitrary precision calculator language
dc (1) - an arbitrary precision calculator
sc (1) - spreadsheet calculator
xcalc (1) - scientific calculator for X

--
"Religion is excellent stuff for keeping common people quiet."
-- Napoleon Bonaparte


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120228141750.GA32201@tal">http://lists.debian.org/20120228141750.GA32201@tal
 
Old 02-28-2012, 01:18 PM
Double Dark
 
Default How to direct output into the LibreOffice Calc

Just have an idear for the question 2. See it below ...

On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:
>Date: Tue, 28 Feb 2012 22:06:48 +0800
>From: lina <lina.lastname@gmail.com>
>To: Debian Lists <debian-user@lists.debian.org>
>Subject: How to direct output into the LibreOffice Calc
>
>Hi,
>
>I wonder:
>
>1]
>
>can the output like:
>
>5
>3
>1
>5
>3
>
>direct it into the LibreOffice directly. without copy and paste.
>
>2]
>
>Is it possible to do a quick sum calculations for some output on terminal.
>
>like the sum of
>
>3
>16
>3
>3
>9
>

We can write a shell script like below to get the sum:

#!/bin/bash
SUM=0
while read NUMBER
do
expr $SUM + $NUMBER
done
echo $SUM

It may be useful. What I want to remind to you is that you should make sure
every line of the input is a number and there is no blank line.

>
>Thanks for your suggestions,
>
>
>best regards,
>
>
>--
>To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
>with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>Archive: http://lists.debian.org/CAG9cJm=tov1gkQwwkd+QCQTEhh88XAeH8=BTkVqDqfhHFycyr w@mail.gmail.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120228141846.GE3839@QGZ.qgz">http://lists.debian.org/20120228141846.GE3839@QGZ.qgz
 
Old 02-29-2012, 10:16 AM
Darac Marjal
 
Default How to direct output into the LibreOffice Calc

On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:
> Hi,
>
> I wonder:
>
> 1]
>
> can the output like:
>
> 5
> 3
> 1
> 5
> 3
>
> direct it into the LibreOffice directly. without copy and paste.

Directly, no. However, LibreOffice has an extensive API[1]. In theory,
you could create a script (there is a python example) that accepts
input, starts LibreOffice and then pastes the lines into cells (I'm
assuming you want the numbers in a spreadsheet). If you have ever
programmed Excel, LibreOffice shouldn't present much of a learning
curve.

[1] http://api.libreoffice.org/

--
Darac Marjal


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120229111615.GB8039@darac.org.uk">http://lists.debian.org/20120229111615.GB8039@darac.org.uk
 
Old 02-29-2012, 12:40 PM
lina
 
Default How to direct output into the LibreOffice Calc

On Wed, Feb 29, 2012 at 7:16 PM, Darac Marjal <mailinglist@darac.org.uk> wrote:
> On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:
>> Hi,
>>
>> I wonder:
>>
>> 1]
>>
>> can the output like:
>>
>> 5
>> 3
>> 1
>> 5
>> 3
>>
>> direct it into the LibreOffice directly. without copy and paste.
>
> Directly, no. However, LibreOffice has an extensive API[1]. In theory,
> you could create a script (there is a python example) that accepts
> input, starts LibreOffice and then pastes the lines into cells (I'm
Thanks, the python example is far more "complicate" than I could
simply copy from terminal, open the Excel and paste.
> assuming you want the numbers in a spreadsheet). If you have ever
> programmed Excel, LibreOffice shouldn't present much of a learning
I don't have much experience in programming in Excel, only know some
very basic functions.
> curve.
>
> [1] http://api.libreoffice.org/

Thanks again for your time,

Best regards,
>
> --
> Darac Marjal
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/20120229111615.GB8039@darac.org.uk
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJmmCWSuWNosKULUUrK6FSmvZny5qaxjkrrPp-gMW3yS_qw@mail.gmail.com">http://lists.debian.org/CAG9cJmmCWSuWNosKULUUrK6FSmvZny5qaxjkrrPp-gMW3yS_qw@mail.gmail.com
 
Old 02-29-2012, 01:47 PM
Christopher Judd
 
Default How to direct output into the LibreOffice Calc

On Wednesday 29 February 2012 08:40:12 lina wrote:

> On Wed, Feb 29, 2012 at 7:16 PM, Darac Marjal <mailinglist@darac.org.uk> wrote:

> > On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:

> >> Hi,

> >>

> >> I wonder:

> >>

> >> 1]

> >>

> >> can the output like:

> >>

> >> 5

> >> 3

> >> 1

> >> 5

> >> 3

> >>

> >> direct it into the LibreOffice directly. without copy and paste.

> >

> > Directly, no. However, LibreOffice has an extensive API[1]. In theory,

> > you could create a script (there is a python example) that accepts

> > input, starts LibreOffice and then pastes the lines into cells (I'm

>




Actually (Ijust figured out), you can do something like:




somescript >tempfile ; localc --calc -o tempfile ; rm tempfile




without learning to use the API.




-Chris







> Thanks, the python example is far more "complicate" than I could

> simply copy from terminal, open the Excel and paste.

>

> > assuming you want the numbers in a spreadsheet). If you have ever

> > programmed Excel, LibreOffice shouldn't present much of a learning

>

> I don't have much experience in programming in Excel, only know some

> very basic functions.

>

> > curve.

> >

> > [1] http://api.libreoffice.org/

>

> Thanks again for your time,

>

> Best regards,

>

> > --

> > Darac Marjal

> >

> >

> > --

> > To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org

> > with a subject of "unsubscribe". Trouble? Contact

> > listmaster@lists.debian.org Archive:

> > http://lists.debian.org/20120229111615.GB8039@darac.org.uk




------------------------------------------------------------------------

| Christopher Judd, Ph. D. |

| Research Scientist III |

| NYS Dept. of Health judd@wadsworth.org |

| Wadsworth Center - ESP |

| P. O. Box 509 518 486-7829 |

| Albany, NY 12201-0509 |

------------------------------------------------------------------------






IMPORTANT NOTICE: This e-mail and any attachments may contain

confidential or sensitive information which is, or may be, legally

privileged or otherwise protected by law from further disclosure. It

is intended only for the addressee. If you received this in error or

from someone who was not authorized to send it to you, please do not

distribute, copy or use it or any attachments. Please notify the

sender immediately by reply e-mail and delete this from your

system. Thank you for your cooperation.
 
Old 02-29-2012, 02:23 PM
lina
 
Default How to direct output into the LibreOffice Calc

On Wed, Feb 29, 2012 at 10:47 PM, Christopher Judd <judd@wadsworth.org> wrote:
> On Wednesday 29 February 2012 08:40:12 lina wrote:
>
>> On Wed, Feb 29, 2012 at 7:16 PM, Darac Marjal <mailinglist@darac.org.uk>
>> wrote:
>
>> > On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:
>
>> >> Hi,
>
>> >>
>
>> >> I wonder:
>
>> >>
>
>> >> 1]
>
>> >>
>
>> >> can the output like:
>
>> >>
>
>> >> 5
>
>> >> 3
>
>> >> 1
>
>> >> 5
>
>> >> 3
>
>> >>
>
>> >> direct it into the LibreOffice directly. without copy and paste.
>
>> >
>
>> > Directly, no. However, LibreOffice has an extensive API[1]. In theory,
>
>> > you could create a script (there is a python example) that accepts
>
>> > input, starts LibreOffice and then pastes the lines into cells (I'm
>
>>
>
>
> Actually (Ijust figured out), you can do something like:
>
>
> somescript >tempfile ; localc --calc -o tempfile ; rm tempfile

Thanks, a bit impressed by the localc --calc

If someone has interest, really welcome "refine" below commands

just tried to calculate the occurance. of those numbers,

(I don't have much CS background except 11 years ago took one course,
seems fundamental knowledge of computer and one semester of C
language. I finished that C without writing a serious program. sorry I
am a bit interested how people think in solving problems, just please
feel free to comment.)

$ more pathway_data.txt | sed 's/[^0-9 ]//g' | tr " " "
" | sed
'/^$/d' | sort | uniq -c | sed -re 's/^ +//g' | sort -n -r > tempfile
; localc --calc -o tempfile ; rm tempfile

$ head pathway_data.txt
[['5', '4', '5'], ['19', '5', '4', '5']]
[['47', '46', '47']]
[['76', '46', '76'], ['76', '34', '76', '34'], ['62', '60', '62', '60', '46']]
[]
[['76', '46', '76'], ['46', '48', '46', '34']]
[['46', '44', '46']]
[['19', '39', '19'], ['19', '5', '4', '5']]
[]

Since thanks for all the help and suggestions,

Best regards,
>
>
> without learning to use the API.
>
>
> -Chris
>
>
>
>> Thanks, the python example is far more "complicate" than I could
>
>> simply copy from terminal, open the Excel and paste.
>
>>
>
>> > assuming you want the numbers in a spreadsheet). If you have ever
>
>> > programmed Excel, LibreOffice shouldn't present much of a learning
>
>>
>
>> I don't have much experience in programming in Excel, only know some
>
>> very basic functions.
>
>>
>
>> > curve.
>
>> >
>
>> > [1] http://api.libreoffice.org/
>
>>
>
>> Thanks again for your time,
>
>>
>
>> Best regards,
>
>>
>
>> > --
>
>> > Darac Marjal
>
>> >
>
>> >
>
>> > --
>
>> > To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
>
>> > with a subject of "unsubscribe". Trouble? Contact
>
>> > listmaster@lists.debian.org Archive:
>
>> > http://lists.debian.org/20120229111615.GB8039@darac.org.uk
>
>
> ------------------------------------------------------------------------
>
> | Christopher Judd, Ph. D. |
>
> | Research Scientist III |
>
> | NYS Dept. of Health judd@wadsworth.org |
>
> | Wadsworth Center - ESP |
>
> | P. O. Box 509 518 486-7829 |
>
> | Albany, NY 12201-0509 |
>
> ------------------------------------------------------------------------
>
>
>
>
> IMPORTANT NOTICE: This e-mail and any attachments may contain
> confidential or sensitive information which is, or may be, legally
> privileged or otherwise protected by law from further disclosure. It
> is intended only for the addressee. If you received this in error or
> from someone who was not authorized to send it to you, please do not
> distribute, copy or use it or any attachments. Please notify the
> sender immediately by reply e-mail and delete this from your
> system. Thank you for your cooperation.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJmm72Z7bohrsHRswkaDOqK8YP9gAwJ7JBK-7zAauxkAUVg@mail.gmail.com">http://lists.debian.org/CAG9cJmm72Z7bohrsHRswkaDOqK8YP9gAwJ7JBK-7zAauxkAUVg@mail.gmail.com
 
Old 03-01-2012, 12:37 PM
Zbigniew Komarnicki
 
Default How to direct output into the LibreOffice Calc

On Tuesday 28 of February 2012 15:06:48 lina wrote:
> Hi,
>
> I wonder:
>
> 1]
>
> can the output like:
>
> 5
> 3
> 1
> 5
> 3
>

What about 'num-utils' ?
There is 'numsum'.

Zbigniew


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201203011437.54563.cblasius@gmail.com">http://lists.debian.org/201203011437.54563.cblasius@gmail.com
 
Old 03-04-2012, 12:33 PM
Arnt Karlsen
 
Default How to direct output into the LibreOffice Calc

On Wed, 29 Feb 2012 03:17:50 +1300, Chris wrote in message
<20120228141750.GA32201@tal>:

> On Tue, Feb 28, 2012 at 10:06:48PM +0800, lina wrote:
> > Hi,
>
> Hi,
>
> > I wonder:
>
> > 2]
>
> Don't know about libreoffice, sorry.
>
> > Is it possible to do a quick sum calculations for some output on
> > terminal.
> >
> > like the sum of
> >
> > 3
> > 16
> > 3
> > 3
> > 9
>
> root@tal:~# cat tt
> 4+6+7
>
> root@tal:~# bc < tt
> 17
>
> root@tal:~# man -k calculator
> bc (1) - An arbitrary precision calculator language
> dc (1) - an arbitrary precision calculator
> sc (1) - spreadsheet calculator
> xcalc (1) - scientific calculator for X

..I raise you qalc: ;o)
arnt@celsius:~$ qalc 240V*2.25A*30days*.33NOK/kWh
(240 * volt * (2.25 * ampere) * (30 * day) * (0.33 * NOK)) / (kilowatt
* hour) = NOK 128.304
arnt@nb6:~$ qalc .33NOK/kWh to €/Btu
warning: It has been more than one week since the exchange rates last
were updated.
(0.33 * NOK) / (kilowatt * hour) = approx. 12.4103(mEUR / kBtu)
arnt@nb6:~$

arnt@celsius:~$ man -k calculator
ata_std_bios_param (9) - generic bios head/sector/cylinder calculator
used by sd.
qalc (1) - Powerful and easy to use command line calculator
qalculate-gtk (1) - Powerful and easy to use desktop calculator
transicc (1) - little cms ColorSpace conversion calculator.
arnt@celsius:~$


>
> --
> "Religion is excellent stuff for keeping common people quiet."
> -- Napoleon Bonaparte

..

--
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
Scenarios always come in sets of three:
best case, worst case, and just in case.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120304143304.7a54b812@nb6.lan">http://lists.debian.org/20120304143304.7a54b812@nb6.lan
 
Old 03-07-2012, 03:15 PM
Chris Bannister
 
Default How to direct output into the LibreOffice Calc

On Sun, Mar 04, 2012 at 02:33:04PM +0100, Arnt Karlsen wrote:
> ..I raise you qalc: ;o)

Yes, I see ;o)
Need to get 1,689 kB of archives.
After this operation, 4,968 kB of additional disk space will be used.

> arnt@celsius:~$ qalc 240V*2.25A*30days*.33NOK/kWh
> (240 * volt * (2.25 * ampere) * (30 * day) * (0.33 * NOK)) / (kilowatt
> * hour) = NOK 128.304
> arnt@nb6:~$ qalc .33NOK/kWh to €/Btu
> warning: It has been more than one week since the exchange rates last
> were updated.

It downloads data when you are online?

> (0.33 * NOK) / (kilowatt * hour) = approx. 12.4103(mEUR / kBtu)
> arnt@nb6:~$

Will have a look at it when I get the chance.

> arnt@celsius:~$ man -k calculator
> ata_std_bios_param (9) - generic bios head/sector/cylinder calculator
> used by sd.

Mmmm, "apt-cache show sd"

--
oops my signature's gone.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120307161505.GA8420@tal">http://lists.debian.org/20120307161505.GA8420@tal
 

Thread Tools




All times are GMT. The time now is 06:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org