I have the following output from Mathematica to C code:$ cat file.txtComplex(1.3, 2.7)*Power(kappa, 2.0) + Complex(0.3, 2.0)*Power(kappa,5.0)*log(alpha)The file is extremely long (many tens of thousands of lines). I would like to replace every Complex(a, b) with (a + i*b) and every Power(a, b) to a^b. So the above sample would look like:$ cat desired_file.txt(1.3 + i*2.7)*kappa^2.0 + (0.3 + i*2.0)*kappa^5.0*log(alpha)How can I use sed to achieve this result? It is not straight forward at all by reading regular expressions and examples out there. How can I do this using sed?
A challenge for sed convert code from Mathematica to Matlab
sed;regular expression