From: Kirsten on 11 Aug 2010 11:26 I'm trying to figure out a way to search for only part of a filename. I have multiple files that have similar components. For example: abc123_5687482 abc124_8914573 abc125_1795362 abc126_7831568 I was wondering if there is a way to have MATLAB do a wildcard search to find if file abc123_5687482 exists by only using abc123 as the search. I've tried using exist() and fopen, but neither one of these seem to recognize wildcard inputs. Thanks!
From: Camille Couzi on 11 Aug 2010 11:39 "Kirsten " <kirsten.swanson(a)swe.org> wrote in message <i3ufec$nto$1(a)fred.mathworks.com>... > I'm trying to figure out a way to search for only part of a filename. I have multiple files that have similar components. > > For example: > abc123_5687482 > abc124_8914573 > abc125_1795362 > abc126_7831568 > > I was wondering if there is a way to have MATLAB do a wildcard search to find if file abc123_5687482 exists by only using abc123 as the search. I've tried using exist() and fopen, but neither one of these seem to recognize wildcard inputs. > > Thanks! Hi Kirsten, I am having the same sort of problem to solve, my file names finish in _V.dat, _D.dat ect... I have been trying with regexp,and searching in the folder with ls. I stay in contact with you if I find an effective way, and please tell me if you manage to do it too. Bye!
From: us on 11 Aug 2010 11:42 "Kirsten " <kirsten.swanson(a)swe.org> wrote in message <i3ufec$nto$1(a)fred.mathworks.com>... > I'm trying to figure out a way to search for only part of a filename. I have multiple files that have similar components. > > For example: > abc123_5687482 > abc124_8914573 > abc125_1795362 > abc126_7831568 > > I was wondering if there is a way to have MATLAB do a wildcard search to find if file abc123_5687482 exists by only using abc123 as the search. I've tried using exist() and fopen, but neither one of these seem to recognize wildcard inputs. > > Thanks! a hint: help regexp; % eg, http://www.mathworks.com/matlabcentral/newsreader/view_thread/288917#770034 us
From: Camille Couzi on 11 Aug 2010 11:51 "us " <us(a)neurol.unizh.ch> wrote in message <i3ugcr$qnp$1(a)fred.mathworks.com>... > "Kirsten " <kirsten.swanson(a)swe.org> wrote in message <i3ufec$nto$1(a)fred.mathworks.com>... > > I'm trying to figure out a way to search for only part of a filename. I have multiple files that have similar components. > > > > For example: > > abc123_5687482 > > abc124_8914573 > > abc125_1795362 > > abc126_7831568 > > > > I was wondering if there is a way to have MATLAB do a wildcard search to find if file abc123_5687482 exists by only using abc123 as the search. I've tried using exist() and fopen, but neither one of these seem to recognize wildcard inputs. > > > > Thanks! > > a hint: > > help regexp; > % eg, > > http://www.mathworks.com/matlabcentral/newsreader/view_thread/288917#770034 > > us Hi again, Look at that too: http://blogs.mathworks.com/pick/2008/09/09/advanced-matlab-file-name-processing-from-directory-listing/ Camille.
From: Jan Simon on 11 Aug 2010 13:05 Dear Kirsten, > For example: > abc123_5687482 > abc124_8914573 > abc125_1795362 > abc126_7831568 > > I was wondering if there is a way to have MATLAB do a wildcard search to find if file abc123_5687482 exists by only using abc123 as the search. I've tried using exist() and fopen, but neither one of these seem to recognize wildcard inputs. Do you mean this: d = dir('abc123*') ? Good luck, Jan
|
Pages: 1 Prev: strange behaviour of spectrogram Next: Finding Braille(embossed printing) in an image |