Author Topic: Importing LTSpice data.txt into OpenOffice spreadsheet  (Read 254 times)

0 Members and 1 Guest are viewing this topic.

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1510
  • Country: ca
Importing LTSpice data.txt into OpenOffice spreadsheet
« on: June 29, 2024, 09:10:59 pm »
So far I learned to import a "sheet from a file", and I've managed to get the 4 columns of data in the .txt to become 4 columns in the SS, but all the numbers have a ' before them.

For the separator options I've tried
separated by = tab
separated by  other = '

Text delimiter = '

And all the numbers display fine on screen in their box, but when you click on them, they all have a ' before them, and when you try and do calculations with them, you get an error. I've tried just copy/pasting their values as just numbers, and it still won't do calculations with those new entries.

Anyone familiar with this ??
« Last Edit: June 29, 2024, 09:15:13 pm by MathWizard »
 

Offline Le_Bassiste

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: de
Re: Importing LTSpice data.txt into OpenOffice spreadsheet
« Reply #1 on: June 30, 2024, 08:37:17 am »
have you checked the decimal separator setting in your OS / spreadsheet program? if it's set to "," then numbers containing a "." will be converted to text during data import.  if you don't want to change that setting (you probably won't), you can search and replace the decimal separator in the *.txt file of the sim-data and then import the data into the spreadsheet.

hth
An assertion ending with a question mark is a brain fart.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6462
  • Country: ro
Re: Importing LTSpice data.txt into OpenOffice spreadsheet
« Reply #2 on: June 30, 2024, 06:40:15 pm »
An apostrophe at the beginning of a spreadsheet cells means the cell contains text (so not a number).  Either import the columns as numbers (not as standard), or let them as they are by default, but produce another 4 columns in your spreadsheet (as formula), where you convert the iported text columns into number columns.

for example, if you have e.g. in cell B3 a text '1234.5, you type in cell F3 the formula =VALUE(B3), then drag the formula down for the entire column, and right for all 4 columns.

Now, the columns F, G, H and I should should contain numbers from the columns B, C, D and E.
The cells from columns F, G, H and I are now numbers, and their cells can be used in math formulas.
 
The following users thanked this post: MathWizard

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1510
  • Country: ca
Re: Importing LTSpice data.txt into OpenOffice spreadsheet
« Reply #3 on: July 01, 2024, 01:48:47 am »
Ok thanks RoGeorge that worked, just using the =VALUE(cell), and I can now do math. In the text file, the only thing between actual numbers, is blank space, that highlights as one entire block. But they aren't all the same size, but I guess they are just tab's.

As far as I've ever seen in windows, LTSpice and OpenOffice, the decimal separator is a period.
« Last Edit: July 01, 2024, 01:50:45 am by MathWizard »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6462
  • Country: ro
Re: Importing LTSpice data.txt into OpenOffice spreadsheet
« Reply #4 on: July 01, 2024, 05:43:44 am »
If you do data post-processing for LTspice files, you may either export CSV then import in a spreadsheet, or if you need more automation, there are Python modules that can read directly from LTspice raw files, without the need of exporting CSV.

It is also possible to run LTspice from Python, such that you can alter various parameters of a schematic in Python, then start the simulation again and again, and retrieve the results also from Python.  Good for long simulations and heavy data post-procesing in Python (let it run over night and find the Python results ready next day).

You may want to know that, by default, LTspice uses lossy compression to save the produced waveforms, so the plots you see in LTspice is interpolated data after decompressing, so not 100% accurate with the simulation.

This usually doesn't matter for just looking at the plots and waveforms, but if you do more advanced processing (for example a FFT), then the artifacts caused by compression/decompression may become visible.  Data compression of the LTspice results can be disabled, either from the LTspice settings, or even better, by adding the needed LTspice directives to your schematic.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf