[Swift-user] Question - csv_mapper

Heather Stoller heather.stoller at gmail.com
Tue Apr 24 15:57:40 CDT 2012


Hi Swift Users,

I'm a student at UChicago working with Mike Wilde and Kyle Chard at the
Computation Institute to try to create a distributed file management
system.  At present, I have a working script that can take two strings
(physical file locations), scp the strings to get their file contents, and
merge their contents together.  Next, I'd like my script to take two
strings (logical file names), transform them to physical file locations by
looking them up in a map somewhere, and then scp the transformed strings to
get their file contents etc.  So I only need to do ONE step at present:
look up strings in a map.  It's been suggested that I use a csv_mapper for
this purpose, so I tried.  Below is my swiftscript and attached is my
logfile.  Could you suggest what might be the matter?  There are liable to
be very elementary mistakes as I am quite a novice swift user.  Thank you
kindly, and please do let me know if anything I've mentioned has been
unclear.  Best regards,
Heather

type file;

type translator {
   string logical;
   string physical;
}

app (file f) echoer(translator t) {
        echo "The name is" t.logical "and the location is" t.physical
stdout=@f;
}

file outfile <"translation.txt">;

translator trans[] <csv_mapper; file="translate.csv">;

trace(trans[0].logical);
trace(trans[0].physical);
trace(trans[1].logical);
trace(trans[1].physical);

#####################################

#  translate.csv  #

#####################################

logical, physical
file1, hstoller at kedzie.cs.uchicago.edu:~/tmp/m
file2, hstoller at kedzie.cs.uchicago.edu~/tmp/n


-- 
Heather Stoller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20120424/c6179948/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: csv_mapper_test-20120424-1545-a02ayqtg.log
Type: application/octet-stream
Size: 4103 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20120424/c6179948/attachment.obj>


More information about the Swift-user mailing list