MATLAB: Loading large .txt file

loading .txt filesloading ascii filesloading large text fileloading timeseries

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

Best Answer

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.
Related Question