ikarosilva / wfdb-app-toolbox

The WFDB Toolbox for MATLAB/Octave is a collection of functions for reading, writing, and processing physiologic signals in the formats used by PhysioNet (see README for details).
http://physionet.org/physiotools/matlab/wfdb-app-matlab/
GNU General Public License v3.0
93 stars 46 forks source link

How to have constant number of spaces in `rdsamp -r nsrdb/16265 -p -v > /tmp/16265.txt`? #135

Closed sami10007 closed 7 years ago

sami10007 commented 7 years ago

Situation: rdsamp's output has a varying number of spaces, causing problems to read the data from .txt ASCII file to MATLAB 2016b

I have to read the data first to my local system. I really would like to read your data manually to MATLAB such that to have the simplest approach to read the data.

Data sample

   Elapsed time    ECG1    ECG2
      (seconds)    (mV)    (mV)
        300.000  -0.005  -0.065
        300.008  -0.015  -0.055
        300.016   0.005  -0.055
        300.023   0.005  -0.075

Data in MATLAB looks like this here and this here, for the following lines of code. Commands done to read the data sample

% http://stackoverflow.com/a/40516998/54964
ecg = dlmread(filename, ' ', 2, 0); % read table with empty columns
ecg = ecg(:,find(any(ecg,1)));  % keep only non-empty columns

MATLAB: 2016b
OS: Debian 8.5
Related thread: http://stackoverflow.com/q/40516749/54964

alistairewj commented 7 years ago

You are using the WFDB toolbox - which is not the MATLAB toolbox. This issue is out of place.

If you type rdsamp -h (to get help with the command), quite literally the first option has the answer:

usage: rdsamp -r RECORD [OPTIONS ...]
where RECORD is the name of the input record, and OPTIONS may include:
 -c          use CSV (comma-separated value) output format

Please try to read the documentation before posting issues or contacting for help.

sami10007 commented 7 years ago

Yes, I will do my best with that.

I propose to change the basic example about reading data with WFDB away from the .txt example and include there also the .csv example as the primary option, to avoid confusions about the thing in the future.

Here, this basic tutorial: https://physionet.org/tutorials/physiobank-text.shtml There is no link to differential solutions in the tutorial such as CSV reading.