|
From: Ethan M. <eam...@gm...> - 2017-05-24 19:49:41
|
Assuming that the subdirectories are not themselves named Datasomething,
I'd use something like
chop(fullname) = fullname[ strstrt(fullname,"Data") : * ]
plot for [FileName in FileList] FileName u 1:2 w l title chop(FileName)
On Wed, May 24, 2017 at 12:36 PM, theozh <th...@gm...> wrote:
> With the following commands (under Windows) I would like to plot several
> datafiles located in several subdirectories, which obey a certain name
> scheme.
>
> FileList = system("dir /B /S Data*.dat")
> plot for [FileName in FileList] FileName u 1:2 w l title FileName
>
> However, with this, FileName always contains the full path,
> e.g. C:\SubDir1\SubSubDir2\Test3\Blabla4\Data007.dat
> which is not very helpful in the legend.
>
> Any ideas how I can separate the path from the filename in gnuplot,
> or even just extract what "*" was, e.g. the number "007"?
> substr() will not work because subpaths can have different length.
> Is there anything like regular expressions in gnuplot?
> Thank you for any hints.
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/
> lists/listinfo/gnuplot-info
>
|