Skip to content

spm_load #1140

@HenkMutsaerts

Description

@HenkMutsaerts

Description

When creating a TSV such as participants.tsv, it is easy for users to leave a few empty cells at the end of a row. This creates problems for xASL_tsvRead->spm_load, which wants the same number of elements for each row. Now I programmed a script to fix this, assuming that the columns in the header are correct.

Tasks

  • spm_load: Automatic fixing empty CSV/TSV cells

  • README_SPM.txt: Add spm_load edit

  • - I can report a list of lines with too few/too much delimiters

  • I will shorten/fill with empty accordingly

  • if no end of lines are in the data, then we revert to a simple total check - anything else is just guessing

  • I will save repaired.

  • I will only cut/add fields, but not lines.

  • @jan-petr This still goes wrong: when loading a line that has sufficient number of delimiters to get to the correct number of cells per line; textscan on line 194 still only reads 8 (so it somehow ignores the last "empty cell"). We could ignore this, but then it is annoying for the user that the participants.tsv, even when "fixed" by xASL_tsvRead->spm_load, will keep repeating a warning.

-> In the first screenshot, the selection contains two tabs at the end of line two; leading to 9 "cells" and a correct line length. However, in the second screenshot, one sees that textscan has loaded only 8 "cells"; somehow ignoring the last \t.

Screenshot 2022-08-13 at 07 50 12

Screenshot 2022-08-13 at 07 52 41

Release notes

Handles an incorrect number of delimiters per line in TSV/CSV/DSV files loaded by spm_load.

Metadata

Metadata

Assignees

Labels

featureNew feature, enhancement or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions