Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Write to file
PostPosted: Thu Sep 22, 2005 5:07 pm 
Dear Research group of Singular.

I would like to know if there are some special command to write into a file the results of Singular but in the same format as the standard output.
When I simply use the write command, I obtain something like this:

x4,y8+3556x2

but, I would like to have something like this:

_[1]=x4
_[2]=y8+3556x2

Is that possible?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Sep 22, 2005 5:21 pm 

Joined: Wed Sep 21, 2005 1:27 pm
Posts: 10
Location: Kaiserslautern, Germany
The solution is provided by the monitor command.

This command writes a copy of the input (or of the output or of both) into a file (with name specified when calling monitor): for instance the Singular session

Code:
> monitor("prot.txt","o");
> ring r=0,(x,y),dp;
> ideal I=x4,  y8+3556x2;
> I;
I[1]=x4
I[2]=y8+3556x2


creates a file prot.txt with the content

Code:
I[1]=x4
I[2]=y8+3556x2


Similarly,

Code:
> monitor("prot2.txt","i");
> ring r=0,(x,y),dp;
> ideal I=x4,  y8+3556x2;
> I;
I[1]=x4
I[2]=y8+3556x2


creates a file prot2.txt with the content

Code:
ring r=0,(x,y),dp;
ideal I=x4,  y8+3556x2;
I;


The writing to a file is terminated when
Code:
monitor("");
is entered.

See also: http://www.singular.uni-kl.de/Manual/3-0-0/sing_238.htm

Christoph Lossen
(Singular Team)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Write to file
PostPosted: Thu Dec 01, 2005 3:45 pm 

Joined: Sat Oct 01, 2005 11:40 am
Posts: 40
Location: IIT Guwahati, Guwahati, Assam, INDIA
One can simply make use of Operating System redirection commands.
e.g. One can use
$ > Singular < myfile.sing > Output.txt
at your command prompt.

If you dont want Singular Headers use -q option.

I am not sure whether this command will work on Windows/Mac? But I guess there should be similar redirection commands.

Regards

Vinay


E-mail to Singular-Team wrote:
Dear Research group of Singular.

I would like to know if there are some special command to write into a file the results of Singular but in the same format as the standard output.
When I simply use the write command, I obtain something like this:

x4,y8+3556x2

but, I would like to have something like this:

_[1]=x4
_[2]=y8+3556x2

Is that possible?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 10:57 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group