跳至主要內容
Zebra Audit斑馬帳務助手

English · Excel 與 CSV 匯入 ·

Confirmed-Mapping Reuse or Per-File Remapping for Recurring Same-Source Files

A bookkeeper receives a second Excel or CSV file from a source whose first file was already mapped and confirmed. There are two methods to choose from. Confirmed-mapping reuse applies the saved column rule to the new file. Per-file remapping treats every file as new and maps each column again. Reuse is faster and more consistent, but only while the new file still has the structure the rule was confirmed against. Remapping is slower and is justified only when that stru

Confirmed-Mapping Reuse or Per-File Remapping for Recurring Same-Source Files

A bookkeeper receives a second Excel or CSV file from a source whose first file was already mapped and confirmed. There are two methods to choose from. Confirmed-mapping reuse applies the saved column rule to the new file. Per-file remapping treats every file as new and maps each column again. Reuse is faster and more consistent, but only while the new file still has the structure the rule was confirmed against. Remapping is slower and is justified only when that structure has changed.

This article covers the rule that decides between the two: apply the saved mapping, and stop at the first header that no longer matches it. It does not walk through a first-time mapping. It assumes one has already been confirmed. It describes bookkeeping practice, not tax advice, and uses no real client records.

How Reuse Works in Practice

The saved rule is a mapping plus a schema check

A confirmed mapping should be stored with the schema it was confirmed against: expected header names, data types, and column count. Power Query's folder-combine workflow follows the same pattern. A transformation is built from a sample file and then reused across the other files in the folder [1]. Because Power Query matches by column name, columns can arrive in a different order without breaking the transformation [1]. Microsoft's documented assumptions are consistent headers, consistent data types, and a consistent number of columns [1].

Those assumptions mark the boundary of safe reuse. Column order is an expected variation. Missing, renamed, retyped, or added columns are not.

The stop condition

Validation runs before the mapping is applied. Reuse proceeds only if every item below passes:

  • Every required column from the confirmed schema is present.
  • Each header matches the saved rule exactly, apart from column order.
  • Each column's values are compatible with the confirmed type (for example, a date column still parses as dates).
  • The file's layout is unchanged, such as the header row position and the absence of new summary rows or extra sheets.
  • The meaning of each field is plausibly unchanged.

The first failure halts processing and sends the file to review. The old mapping is not forced onto a file it no longer fits.

Comparing the Approaches

The table covers the reuse method and the matching techniques that can support or replace it. Each is listed with its constraint and the point where it breaks down [1][2][3].

MethodConstraintWhere it fails
Reuse a confirmed mappingSuits a stable recurring source; avoids remapping each file. Works as a saved rule plus a schema check.A source change can make the mapping wrong or cause errors. A matching column name does not prove the meaning is unchanged.
Name-based matchingCheap and simple; works when headers are stable and meaningful.Misses synonyms and renamed fields. Can confuse homonyms, abbreviations, or concatenated names.
Type-, value-, and constraint-based matchingAdds evidence from compatible types, value patterns, key status, or integrity constraints. Useful for checking or suggesting matches.Types can be underspecified or misleading. Data may be unavailable or unrepresentative. Structural clues are brittle, and no single clue is dependable alone.
Combined or learned matchingCombines several clues or reuses mappings from prior tasks to handle variation and cut repeated manual work.Still needs validation. Past examples may not capture the new file's intent or a genuinely changed schema.

*Table note: Zebra Audit is one observed operator in this workflow. It applies a previously confirmed mapping to later files from the same source and pauses when a header departs from the saved rule. The table is a comparison of methods, not a ranking of tools.*

Why Name Agreement Is Not Enough

Same header, different meaning

A column titled "Amount" can change from a signed value to an absolute value, or from a gross figure to a net one. The header still matches and the type is still numeric, yet the mapping is now wrong. The reuse row of the table states this limit directly: a matching column name does not prove that its meaning is unchanged [2][3]. A schema check catches structural drift but cannot confirm semantics, so a reviewer should look again whenever the source announces a system migration, an export setting change, or a new report version.

Why layered checks are still partial

Type and value checks add evidence beyond names, and combined or learned approaches add more by drawing on earlier mappings [2][3]. Each layer still rests on incomplete evidence. The sample data may not represent the new file. Types may be underspecified, and a past example may not anticipate a real change in intent. For this reason the layered signals work as a way to flag a file for review, not as grounds to approve it automatically.

Handling Schema Drift

Classify the change

Drift in a recurring file usually falls into one of four categories:

  1. Added columns. The new column has no rule. Decide whether it is relevant, then extend the mapping deliberately.
  2. Missing columns. A required field is absent. Processing should not continue by guessing or defaulting.
  3. Renamed columns. The new header may be a synonym, but it might also be a different field. Confirm with the source or a sample of values.
  4. Incompatible types. A field that was numeric now contains text, or date formats have shifted. Find out whether the change is a one-time anomaly or a permanent export change.

Update the rule deliberately

When the change is legitimate, update the saved mapping as a recorded revision instead of patching it quietly. Then confirm the output columns and their types, and keep the revised schema as the new baseline for later files. If the change turns out to be a one-time error at the source, leave the rule untouched and request a corrected file.

Why the Fail-Safe Matters

Remapping every file is expensive. In data integration generally, creating mappings can consume over half of the total effort and sometimes up to 80% [2][3]. Reuse removes much of that cost for sources that stay stable. The same literature stresses that the evidence used to infer mappings is inherently incomplete [2][3]. A reuse policy therefore needs both parts: speed from the saved rule, and a hard stop when the file no longer fits it.

Scope and Limits

This workflow covers file-structure handling only. It is bookkeeping practice, not tax advice, and it does not describe the work of an accounting firm. It does not address cost-basis methods or profit-and-loss calculation. Examples here are illustrative and contain no real client records. Power Query behavior is cited from Microsoft's documentation for its folder-combine feature [1]. Other tools may differ in how they match columns and report errors, so the schema check should be defined outside any one tool.

References

  1. https://support.microsoft.com/en-gb/Excel/import-data-from-a-folder-with-multiple-files-power-query
  2. https://www.cs.toronto.edu/~yuana/researchInterests/why-dont-mix.pdf
  3. http://www.dit.unitn.it/~p2p/RelatedWork/Matching/si-survey-db-community.pdf

文章是整理實務,不構成申報或稅務意見。