From 9e2dbe43abe97c4e60b158e5fa52172468a2afb8 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 13 Mar 2025 20:17:51 +0100 Subject: Declare the files to load from an external configuration file --- examples/dataset.toml | 2 ++ examples/importer.toml | 17 +++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 examples/dataset.toml (limited to 'examples') diff --git a/examples/dataset.toml b/examples/dataset.toml new file mode 100644 index 0000000..dd72cd2 --- /dev/null +++ b/examples/dataset.toml @@ -0,0 +1,2 @@ +[files] + source = "financial.xlsx" diff --git a/examples/importer.toml b/examples/importer.toml index 08e9e25..a8ee199 100644 --- a/examples/importer.toml +++ b/examples/importer.toml @@ -1,23 +1,25 @@ +dataset = "dataset.toml" + [source] - file = "financial.xlsx" name = "source" + # The file is looked up in the dataset -[externals.target] +[externals.source-target] intern_key = ":source.A ^ '-suffix'" extern_key = ":A ^ '-suffix'" - file = "financial.xlsx" allow_missing = false + # The file is looked up in the dataset [externals.a_financial] - intern_key = ":target.A" - extern_key = ":O" # This key is here to generate errors + intern_key = ":source-target.A" + extern_key = ":O" file = "financial.xlsx" allow_missing = false [sheet] columns = [ - ":target.A ^ '\\''", # Ensure the quote is escaped before sending to the sql engine - "join('-', :A, :target.E, :B)", + ":source-target.A ^ '\\''", # Ensure the quote is escaped before sending to the sql engine + "join('-', :A, :source-target.E, :B)", ":C", "counter([:C], [:A])", "sum(:F, [:B, :C, :D], [:B])", @@ -40,4 +42,3 @@ ] sort = [] - uniq = [] -- cgit v1.2.3