[Swift-user] many-to-one mapping
Mihael Hategan
hategan at mcs.anl.gov
Tue Dec 11 20:11:43 CST 2012
On Tue, 2012-12-11 at 14:02 -0600, Neil Best wrote:
> On Mon, Dec 10, 2012 at 8:23 PM, Mihael Hategan <hategan at mcs.anl.gov> wrote:
> > file foo[] <filesys_mapper; location=@strcat("data/nc/", year, "/"),
> > pattern=@strcat("narr-a_221_1_", year, "????_??00_000.single.nc")>;
>
> This is starting to make some sense to me. Unfortunately the data for
> a given year spans 12 monthly directories (data/nc/197901,
> data/nc/197902, etc.). Therefore I would like to be able to say:
>
> foreach year in [1979:2011] {
> file thisYear[]<filesys_mapper;
> location= @strcat( "data/nc/", year, "*"),
> pattern= @strcat( "narr-a_221_", year, "????_??00_000.single.nc")>;
> . . .
>
> ("*" glob at the end of location) but this does not work, nor do I
> expect it to. I am sure that location is meant to be a literal, not a
> glob. That's why I thought I needed a regex. Is there a work-around
> other than the obvious rearrangement of the data?
Not that I can think of.
I filed this for now:
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=897
More information about the Swift-user
mailing list