Dear all,<br><br>My simple wc swift script is below, and I keep getting the error: "Missing -if argument", can anyone help me with that?<br><br>type inputfile {};<br>type outputfile {};<br>(outputfile o) fileWc(inputfile file) {<br>
    app {<br>        wc "-w" @filename(file) stdout=@filename(o);<br>    }<br>}<br>(outputfile ofiles[]) mainLoop(inputfile files[]) {<br>    foreach file,i in files {<br>        ofiles[i]=fileWc(file);<br>    }<br>
}<br>inputfile files[]<filesys_mapper;location="./data",prefix="sdata">;<br>outputfile ofiles[]<simple_mapper;prefix="out",suffix=".txt">;<br>ofiles=mainLoop(files);<br>
======================<br><br>Also, I have a question: if I want to use csplit to split one big file to a number of small file:<br>/usr/bin/csplit -f myprefix mybigfile 1000 {*}<br>which basically splits mybigfile into many small file myprefix01, myprefix02, ..., myprefix99.<br>
How can I do that? I try<br><br>(outfile outf[]) split(infile f) { app {....} }<br>infile f<"foo.txt">;<br>outfile<span class="codeline"> outfile[] <simple_mapper;prefix=<span class="string">"baz"</span><span>,suffix=</span><span class="string">".txt"</span><span>>; <br>
outfile=split(f);<br><br>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?<br></span></span><br>Thank you very much<br><br>Quan Pham