PDA

View Full Version : changing output medium



vivek.pandey
January 3rd, 2011, 04:36 PM
suppose i write a program in c++ in a text editor and then ompile and run it on termainal we receive the output on terminal itself.. byt say i m using python as a calulator and want that the output its producing on terminal should instead go on a particular line in a text editor or a particular cell in spreadsheet.. how can i do this... pls somebody help..thanx a lot :confused::confused::confused:

vivek.pandey
January 3rd, 2011, 05:40 PM
suppose i write a program in c++ in a text editor and then ompile and run it on termainal we receive the output on terminal itself.. byt say i m using python as a calulator and want that the output its producing on terminal should instead go on a particular line in a text editor or a particular cell in spreadsheet.. how can i do this... pls somebody help..thanx a lot :confused::confused::confused:

somebody pls come up wid a solution

vivek.pandey
January 5th, 2011, 06:53 PM
any1 pls come up wid a suggestion

vivek.pandey
January 9th, 2011, 04:35 PM
well no answer yet..pls som1 give me a solution to this question:o:o:o:o:o

nick_goodfate
January 9th, 2011, 04:44 PM
check this which explains piping:

http://www.datasavantconsulting.com/roland/piping.html

vivek.pandey
January 9th, 2011, 05:20 PM
check this which explains piping:

http://www.datasavantconsulting.com/roland/piping.html

well thanx for the link but the tutorial is too concise and i need bit in detail

nick_goodfate
January 9th, 2011, 06:01 PM
well at least now you know that what you want to do is called piping, in case you didn't already knew...

from the moment you send the output of your program to an other device/program instead of the standard output (your terminal), it's up to this device/program what will do with this output. So you may need to check the manual of gedit(if you want to send the output to a txt)

"man gedit" in terminal without ""

and of course you can search Google for mare details about piping and redirection...

QLee
January 9th, 2011, 06:17 PM
Marke this thread as solved and post in the Programming Talk forum.
http://ubuntuforums.org/forumdisplay.php?f=39

Post your complete program and indicate where it's not doing what you want it to do. Other coders will be able to see what you need to change. Don't just ask general questions, be specific.

...Or you could ask a moderator to move your question but still be more specific if you want useful help.

vivek.pandey
January 9th, 2011, 07:12 PM
well at least now you know that what you want to do is called piping, in case you didn't already knew...

from the moment you send the output of your program to an other device/program instead of the standard output (your terminal), it's up to this device/program what will do with this output. So you may need to check the manual of gedit(if you want to send the output to a txt)


and of course you can search Google for mare details about piping and redirection...

thanx for ur help sir but pls see my original question it needs a bit of more understanding like to output a result on a particular line.. i wud really be grateful if som1 gives me a simple example to illustrate wat i want.. thanx

Elfy
January 9th, 2011, 07:16 PM
moved to programming

please post in english - thank you

nick_goodfate
January 9th, 2011, 09:54 PM
thanx for ur help sir but pls see my original question it needs a bit of more understanding like to output a result on a particular line.. i wud really be grateful if som1 gives me a simple example to illustrate wat i want.. thanx

Be more specific on what you want. Give an example. For example, which is the form of the file in which you want to send your output? It's an empty one and you want to write to the end of it? is it something like that:

line1
line2
line3
and you want to put it after "line2"? Then you have to read the file line after line and when you read "line2" write your output.
Anyway i hope you find someone to help you, but i'm really suggesting you to do what QLee told you...