Filter löschen
Filter löschen

Rowfilter option in datastore to search for specific pattern in strings

18 Ansichten (letzte 30 Tage)
I have a large parquest datastore with several files consisting several rows and four columns. One of these columns have strings of long names. I'd like to extract all of those names that contain a specific pattern, eg:'OS.V' . Normally, i use contains(df.column_C, 'OS.V'), to get the list. But within filter, this throws an error. Is there another way to approach this? Thanks
df.rowfilter = c; c = (df.column_C=="TUB1.OS.V"); %this gives that specific tag%
%but not this%
c = contains(df.column_C, 'OS.V'); % I'd like to extract "TUB1.OS.V", "M.TUB2.OS.V",...
  1 Kommentar
Simon Sigl
Simon Sigl am 25 Okt. 2023
Similar problem here. I would like to specify a filter condition based on a list/set:
aTable = (some tall array);
ids2Filter = ["id1", "id2"];
rf = rowfilter(aTable);
rf2 = rowfilter(ismember(rf.id, ids2Filter)) %ismember does not accept rowfilter
how can this be done?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Pratyush
Pratyush am 25 Sep. 2023
Hi Surya,
I understand that you want to filter rows from your datastore which have a specific pattern for a given column.
Modify your code in the following manner to use contains:
checkPattern = @(str) contains(str, 'OS.V');
c = @(df) checkPattern(df.column_C);
  2 Kommentare
Surya Kandukuri
Surya Kandukuri am 2 Okt. 2023
Umm.. that doesnt seem to work either...
Error using reconstructAfterSettingImportOptions
Expected RowFilter to be one of these types:
matlab.io.RowFilter
Instead its type was function_handle.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by