export input/output worksheet as text

Messages in english

Modérateur : xcasadmin

Répondre
compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

export input/output worksheet as text

Message par compsystems » mer. sept. 19, 2018 1:13 am

Hello BP, I have a database of 2000 examples. Now with xcas I can capture only the entries, see partial list attached.

Please can add a function to capture both entries and outputs, with the purpose of sharing this information in several forums and the writing of texts, guides, docs etc using xcas

Thank you

idea
File export xcas text (Full in/out worksheet)

Code : Tout sélectionner

1_in: ifactor(12345)
1_out: 3*5*823
2_in: ifactor(-24); ifactor(24!)
2_out: (-2^3)*3, 2^22*3^10*5^4*7^3*11^2*13*17*19*23
File export xcas text

Code : Tout sélectionner

/* Elementary Number Theory */
ifactor(12345)
ifactor(-24); ifactor(24!)
gcd(a,b) // Greatest Common Divisor
gcd(35, 15, 65) 
gcd(2^14 + 3^8 + 5^9, 3^4 + 7^3); gcd(-104, 221)
lcm(a,b) // Least Common Multiple
lcm(35, 15, 65) // Least Common Multiple
lcm(6, 8); lcm(104, 221)
binomial(a,b) //  Binomial Coefficients
binomial(5,2) 
binomial(a,5)
[a!, 3!, 7!, 10!] // Factorials
/* Real Numbers */
9.6*pi - 2.7*pi; 9.6*'pi' - 2.7*'pi' // Arithmetic
42*( 2/3 + 1/7 ) * sqrt(2)
(2/3) / (8/7) 
exact(0.125) // rational
exact(4.72)
exact(6.9*pi)
exact(3.1416 ) 
approx(3927/1250, 1/8) // float, Numerical Approximations
[3^4, (2.5)^(4/5), 3^-4, 0.4^32] // Powers and Radicals
surd(0.008,3); surd(18.234,5); surd(24,2); surd(16/27,3); surd(16,4); surd(-8,3) // Radical notation for roots
autosimplify(2); surd(16/27,3) // irrational number
autosimplify(2); surd(16/27,3)
autosimplify(2); surd(162*pi^6,4)
approx(3*pi*(2*pi^2)^(1/4)); approx(3*pi^(3/2)*surd(2,4))
autosimplify(0); surd(162*pi^6,4)
autosimplify(1); surd(162*pi^6,4)
autosimplify(2); 1/sqrt(2) // Rationalizing a Denominator
autosimplify(0); 1/sqrt(2)
autosimplify(2); 1/(sqrt(2)+sqrt(3))
autosimplify(1); 1/(sqrt(2)+sqrt(3))
autosimplify(2); (sqrt(2)+sqrt(3))/(sqrt(5)-sqrt(7))
autosimplify(0); (sqrt(2)+sqrt(3))/(sqrt(5)-sqrt(7))
autosimplify(0); -1/2 * (sqrt(2) + sqrt(3)) * (sqrt(5) + sqrt(7))
/* Functions and Relations */
abs(a) // Absolute value
abs(-11.3)
max(a,b); min(a,b); // Maximum and Minimum
max( 12/3,-sqrt(63), 7.3 )
min( 12/3,-sqrt(63), 7.3 ) 
max( 27, 65/2, -14 )
min( 27, 65/2, -14 )
floor(5.6); ceil(5.6) // Greatest and Smallest Integer Functions 
floor(43/5); ceil(43/5)
floor(-11.3); ceil(-11.3)
floor(pi+e); ceil(pi+e)
evalb( e^(i*pi) = -1 ) // Checking Equalities and Inequalities
evalb( pi=3.14 )
evalb( asin(sin(a)=a) )
asin(sin(a))
evalb( (9/8-8/9) = abs(9/8-8/9) )
evalb( pi^e-e^pi = abs(pi^e-e^pi) )
pi^e-e^pi = abs(pi^e-e^pi)
(9/8) < (8/9)
pi^e < e^pi
evalb(sqrt(2)^2=2)
(5^6 < 6^5) and (1=1); (5^6 > 6^5) and (1=1)
(5^6 < 6^5) or (1=1); (5^6 > 6^5) or (1=1)
(1 = 1) or (1=0)
( e^pi = pi^e ) and (0=0)
/* Union, Intersection, and Difference */
[1,2,3] union [a,b,c]
[1,2,3] union ([3,5] union [7])
[sqrt(2), pi, 3.9, r] union [a,b,c]
[1,2,3] intersect [2,4,6]
[1,2,3] intersect [a,b,c]
[a,b,c, d] intersect [d, ee, f]
set[]
[1,2,3] intersect []
[1,2,3] minus [2,4]
[1,2,3] minus [a,b,c]
[a,b,c,d] minus [d, ee, f]
/* Complex Numbers */
i
sqrt(-5)
i/(1+i)
abs(i) // Absolute Value
abs(1+i)
conj(a+i); conj(1+i)// Complex conjugate
re(1 + i); im(5 - 3*i)  // Real and Imaginary Parts
6_ft + 8_ft; 10_m * 5_m  // Arithmetic Operations with Units
6_ft * 8_ft
4_ft + 16_inch 
convert(5.33333333333_ft,1_m) // Converting Units
4_d + 3_mn 
convert(4.00208333333_d,1_s) 
10_mile/15_s
convert((2/3)_(mile*s^-1.0),1_m/1_s) 
convert(7_ft,1_inch)
convert(458.4_deg,1_rad)
convert(50_mile/1_h,1_km/1_h)
convert(47_lb,1_kg)
convert(8_rad,1_deg)
1440./pi
/* Algebra */
(3*x^2 + 3*x )+(8*x^2+7)
(3*x^2 + 3*x )/(8*x^2+7)
((x + 1)^-1)*((x + 1)^-1)
expand(((x + 1)^-1)*((x + 1)^-1))
(3*x^2 + 3*x -1 )*(8*x^2+7)
(3x^5 +3x^3 -4x^2 + 5)/(8x^2 +7)  ... 

parisse
Messages : 5112
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: export input/output worksheet as text

Message par parisse » mer. sept. 19, 2018 9:01 am

Assuming you have exported your inputs in a file named test.cas, you can run from a shell

Code : Tout sélectionner

export GIAC_SHOWCOMMAND=1
icas test.cas
You can redirect output to another file with >.

compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: export input/output worksheet as text

Message par compsystems » mer. sept. 19, 2018 2:22 pm

Shell is xcasen.bat?

parisse
Messages : 5112
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: export input/output worksheet as text

Message par parisse » mer. sept. 19, 2018 6:09 pm

No, I mean a terminal under linux or mac os or something equivalent under windows.

compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: export input/output worksheet as text

Message par compsystems » jeu. sept. 20, 2018 1:49 pm

I copied the file test.cas, in the installation directory C:\XCAS, then I'm trying this

C:\XCAS> export GIAC_SHOWCOMMAND=1 icas test.cas [enter]

generates the following problem
The term 'export' is not recognized as the name of a cmdlet,

parisse
Messages : 5112
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: export input/output worksheet as text

Message par parisse » jeu. sept. 20, 2018 4:38 pm

Windows commandline does not work, you need a bash-compatible terminal.

compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: export input/output worksheet as text

Message par compsystems » mer. sept. 26, 2018 1:30 pm

parisse a écrit :
jeu. sept. 20, 2018 4:38 pm
Windows commandline does not work, you need a bash-compatible terminal.
Do you know any for Windows 10?

parisse
Messages : 5112
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: export input/output worksheet as text

Message par parisse » mer. sept. 26, 2018 5:57 pm

I don't know, I don't have windows 10. I would recommend to install a linux distribution.

compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: export input/output worksheet as text

Message par compsystems » jeu. sept. 27, 2018 3:20 am

I do not handle linux-os, final request, I need to capture in text format both the inputs and the outputs, please if you can of your appreciated time include this option in the PC version, I would be very grateful.

otherwise, I have to copy and paste output by output, think if my work sheet has more than 1000 lines

Thank you very much

parisse
Messages : 5112
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: export input/output worksheet as text

Message par parisse » jeu. sept. 27, 2018 5:53 am

What's wrong with installing Linux?
Why should I spend my time to add a feature that nobody except you will use, if this feature is already available in a Unix environment that you can easily access ? Of course you will have to spend a little of *your* time to install Linux, but believe me you will be rewarded from your time. By the way, it seems that Microsoft has some support for Linux now in Windows 10.

compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: export input/output worksheet as text

Message par compsystems » jeu. sept. 27, 2018 6:11 pm

parisse a écrit :
jeu. sept. 27, 2018 5:53 am
What's wrong with installing Linux?
Why should I spend my time to add a feature that nobody except you will use
I have a very old laptop PC, I can not install two operating systems.

If you add that function, who guarantees that I would be the only one? You can not infer anything, it could be that many are very useful.

parisse
Messages : 5112
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: export input/output worksheet as text

Message par parisse » jeu. sept. 27, 2018 6:46 pm

Hum, I'm a little bit puzzled because if I remember correctly you asked questions about windows 10. This certainly does not run on old hardware.
For your information, I maintain Xcas debian packages for netbooks with 1G of RAM and 8GB of hard disk that are about 8 years old (we lend them to students). I'm sure you have more capable hardware...

Répondre