help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

manipulate filename


From: Rick T
Subject: manipulate filename
Date: Sat, 19 Nov 2011 04:46:59 -1000



Greetings All

I have several files in a directory and I would like to loop through and get a specific section of the filename

Example: of filenames
test 34_0001_hz.txt
testacv123_0002_hz.txt
test1a_0003_hz.txt
test2b3_0004_hz.txt

I would just like to loop through and get the 
0001
0002
0003
0004
and place that in a variable.  I was thinking of just search for the first "_" and the last "_" and taking the values in between. 
Is my logic correct and if so what would be the command to do this?  Also if there is an easier way please let me know

Thanks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]