[Swift-user] Error: "Missing -if argument"

Quan Tran Pham quanpt at cs.uchicago.edu
Thu Feb 21 23:42:06 CST 2008


Dear all,

My simple wc swift script is below, and I keep getting the error: "Missing
-if argument", can anyone help me with that?

type inputfile {};
type outputfile {};
(outputfile o) fileWc(inputfile file) {
    app {
        wc "-w" @filename(file) stdout=@filename(o);
    }
}
(outputfile ofiles[]) mainLoop(inputfile files[]) {
    foreach file,i in files {
        ofiles[i]=fileWc(file);
    }
}
inputfile files[]<filesys_mapper;location="./data",prefix="sdata">;
outputfile ofiles[]<simple_mapper;prefix="out",suffix=".txt">;
ofiles=mainLoop(files);
======================

Also, I have a question: if I want to use csplit to split one big file to a
number of small file:
/usr/bin/csplit -f myprefix mybigfile 1000 {*}
which basically splits mybigfile into many small file myprefix01,
myprefix02, ..., myprefix99.
How can I do that? I try

(outfile outf[]) split(infile f) { app {....} }
infile f<"foo.txt">;
outfile outfile[] <simple_mapper;prefix="baz",suffix=".txt">;
outfile=split(f);

but does not work. I figure the split part can be done at one node, hence
can be done outside swift, but there should be some other ways?

Thank you very much

Quan Pham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20080221/bbc3d5f0/attachment.html>


More information about the Swift-user mailing list