CSVfox
Get the job done.

%slice Example with 3 CSV Tables

Various flavors of %slice with three CSV tables

The source tables

This example puts three tables together with %merge, and builds a newly-structured table from them using %slice.

This one-week food plan table in English language is used as the root table:
meals-en.csv
WeekdayDateBreakfastLunchDinner
Monday2024-12-16MuesliColorful garden saladNoodle soup
Tuesday2024-12-17MuesliSandwichesTomato soup
Wednesday2024-12-18MuesliLamb's lettucePotato soup
Thursday2024-12-19Bread rollsColeslawChicken soup
Friday2024-12-202 rollsTomato saladFish soup

Furthermore, there is a similar plan in Spanish language:
meals-es.csv
Día laborableFechaDesayunoAlmuerzoCena
martes2024-12-17MuesliSándwichesSopa de tomate
miércoles2024-12-18MuesliCanónigosSopa de patatas
Jueves2024-12-19Bollos de panEnsalada de colSopa de pollo
Lunes2024-12-16MuesliEnsalada colorida de la huertaSopa de fideos
Viernes2024-12-202 panecillosEnsalada de tomateSopa de pescado

And also in German language:
meals-de.csv
WochentagDatumFrühstückMittagessenAbendessen
Sonntag15.12.2024KaffeePizzaAalsupp
Montag16.12.2024MüsliBunter GartensalatNudelsuppe
Dienstag17.12.2024MüsliSandwichesTomatensuppe
Mittwoch18.12.2024MüsliFeldsalatKartoffelsuppe
Donnerstag19.12.2024BrötchenKrautsalatHühnersuppe
Freitag20.12.20242 BrötchenTomatensalatFischsuppe

Merging the three tables using %merge

At first, we want to just straightly merge all tables into a single output table, with the respective date field as the reference field. The %merge command simply concatenates all fields of all tables, starting with the input table.

The English and the Spanish date format are identical, so the date field of the Spanish CSV table can be referred directly.
But regarding the German CSV table, the date format has to be changed from YYYY-MM-DD to DD.MM.YYYY. We use an intermediate helper variable for this, named [[german-date]] , which is built using a regular expression.
Furthermore, the redundant date fields (Spanish: [Fecha] and German: [Datum]) should be discarded.

A %job file for processing all of this will look like this:

merge3.job
# the input file meals-de.csv # make the helper variable +regex[[german-date]]=[Date]/(\d\d\d\d)-(\d\d)-(\d\d)/\3.\2.\1 # merge the Spanish table %merge[Date]=[Fecha]@meals-es.csv.txt +delete[Fecha] # merge the German table %merge[[german-date]]=[Datum]@meals-de.csv.txt +delete[Datum] # the output file meals-merged.csv


And this processing will result in

meals-merged.csv
WeekdayDateBreakfastLunchDinnerDía laborableDesayunoAlmuerzoCenaWochentagFrühstückMittagessenAbendessen
Monday2024-12-16MuesliColorful garden saladNoodle soupLunesMuesliEnsalada colorida de la huertaSopa de fideosMontagMüsliBunter GartensalatNudelsuppe
Tuesday2024-12-17MuesliSandwichesTomato soupmartesMuesliSándwichesSopa de tomateDienstagMüsliSandwichesTomatensuppe
Wednesday2024-12-18MuesliLamb's lettucePotato soupmiércolesMuesliCanónigosSopa de patatasMittwochMüsliFeldsalatKartoffelsuppe
Thursday2024-12-19Bread rollsColeslawChicken soupJuevesBollos de panEnsalada de colSopa de polloDonnerstagBrötchenKrautsalatHühnersuppe
Friday2024-12-202 rollsTomato saladFish soupViernes2 panecillosEnsalada de tomateSopa de pescadoFreitag2 BrötchenTomatensalatFischsuppe


blabla.


 
Under construction, coming soon