Batch process files with Ifa-Lang's powerful I/O and concurrency features.
Process multiple files in parallel - resize images, convert formats, or extract data.
// Batch File Processor
ayanmo files = Odi.akojopo("input/*.txt");
ayanmo processed = 0;
// Process files in parallel
Osa.pelu_ara(files, ese(file) {
ayanmo content = Odi.ka(file);
// Transform content
ayanmo upper = Ika.uppercase(content);
// Write to output
ayanmo outname = Ika.ropo(file, "input/", "output/");
Odi.ko(outname, upper);
processed = processed + 1;
});
Irosu.fo("Processed " + processed + " files");
// Parse and transform CSV
ayanmo csv = Odi.ka("data.csv");
ayanmo lines = Ika.pin(csv, "\n");
ayanmo output = [];
fun line ninu lines {
ayanmo fields = Ika.pin(line, ",");
ti Ogunda.len(fields) >= 2 {
ayanmo name = Ogunda.gba(fields, 0);
ayanmo value = Ogunda.gba(fields, 1);
Ogunda.fi(output, name + ": " + value);
}
}
Odi.ko("output.txt", Ika.so(output, "\n"));