1
$\begingroup$

I have a text file "IQ256.txt" with the following format (one complex pair per line):

-23636.100 13359.055I  
-25478.040 9342.004I  
-26637.370 5257.033I  
-27184.020 1087.021I  
-27069.778 -2976.033I  
-26338.223 -6446.660I  

which I want to import into Mathematica for spectral analysis. I'm having trouble doing this. Can someone help this newbie?

$\endgroup$
0

2 Answers 2

2
$\begingroup$

This interpreter works DelimitedSequence["ComplexNumber"], you can use it with SemanticImport:

SemanticImport["IQ256.txt", DelimitedSequence["ComplexNumber"]]

Or interpret the string directly:

Interpreter[DelimitedSequence["ComplexNumber"]] @ Import["IQ256.txt"]
$\endgroup$
1
$\begingroup$

E.g:

Total[ToExpression[Import["asd.txt", "Data"]], {2}]
$\endgroup$
1
  • $\begingroup$ Thanks! That works! $\endgroup$
    – Doug
    Aug 4, 2021 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.