Loading large .txt file

1 visualizzazione (ultimi 30 giorni)
Manolis Mylonakis
Manolis Mylonakis il 12 Feb 2021
Hello
I am trying to load a large(3gb) .txt file that contains a timeseries. I have tried many ways but nothing seems to work. I cannot understand why
Ws= load('era5_wind_speed_100m_2d.txt', '-ascii'); doesn't work. I get the message: "Unable to read file 'era5_wind_speed_100m_2d.txt'. Input must be a MAT-file or an ASCII file containing numeric data with same number of columns in each row." I know that the file contains numeric data and has the same number of columns in each row. Plus the same code works just fine with similar data. The only way I found opening the file was with: WS = readtable('era5_wind_speed_100m_2d.txt'); but it turns my data into a matrix and I cannot work with it. I cannot even multiply the table with a numer, when i try this, i get: "Operator is not supported for operands of type 'table'". Any ideas how can i Load my data with proper format or how can i turn the operand "table" into a normal matrix
Thanks in advance

Risposta accettata

Cris LaPierre
Cris LaPierre il 12 Feb 2021
If your data is all of the same data type, try readmatrix.
You can also explore additional options for loading text files, including doing so interactively, here.
  1 Commento
Manolis Mylonakis
Manolis Mylonakis il 12 Feb 2021
Thank you very much, read matrix worked just perfect

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by