Inferensys

Prompt

Multi-Value Field Normalization Prompt

A practical prompt playbook for using Multi-Value Field Normalization Prompt in production AI workflows.
Developer designing multi-agent workflow on laptop, architecture diagram on screen, casual home office setup with afternoon light.
PROMPT PLAYBOOK

When to Use This Prompt

Identify the ideal integration point for the multi-value field normalization prompt and recognize when a simpler or different approach is required.

This prompt is designed for data engineers and ETL developers who need to transform a single string containing multiple values into a clean, predictable array or delimited field for downstream ingestion. The ideal use case is a pipeline stage where you have already extracted a raw, delimited string from a source system (a CSV export, a legacy database column, a log file, or an API response) and you need to enforce a strict contract before loading it into a target data warehouse, search index, or operational database. The prompt handles the full normalization pipeline: delimiter detection, splitting that respects quoted substrings, whitespace trimming, deduplication, value-level normalization, and reassembly with a target delimiter. It also produces structured flags for ambiguous cases, making it suitable for pipelines that require a human review or quarantine queue for unparseable records.

Use this prompt when the source delimiter is unknown or inconsistent, when values may contain the delimiter character inside quotes, or when you need to apply a normalization rule (such as lowercasing, standardizing codes, or mapping to a canonical form) to each individual value after splitting. It is particularly valuable when you cannot rely on a simple SPLIT() function in your ETL tool because of these edge cases. For example, a field like "Austin, TX", "Dallas, TX"; Houston, TX contains mixed delimiters and quoted commas that would break a naive split. This prompt is designed to detect the primary delimiter, correctly parse the quoted values, and flag the mixed-delimiter anomaly in its output. You should also use it when you need an audit trail of what was cleaned, deduplicated, or normalized, as the prompt can be instructed to return both the final list and a change log.

Do not use this prompt for simple, predictable delimiters where a native function like STRING_SPLIT in SQL or .split(',') in Python is sufficient and you have full control over the input format. If your source system guarantees a single, consistent delimiter with no quoted values and no normalization requirement, a code-based solution will be faster, cheaper, and more deterministic. Similarly, avoid this prompt if you are dealing with structured formats like JSON arrays or XML lists that should be parsed with a dedicated library rather than treated as a delimited string. For high-volume streaming pipelines processing millions of records per second, the latency and cost of an LLM call may be prohibitive; in those cases, use this prompt to generate a robust parsing specification and then implement that specification in code. Finally, if the normalization rule requires a lookup against a massive, frequently updated reference dataset, it is more reliable to split and clean with this prompt and then perform the lookup in a subsequent, deterministic pipeline step rather than embedding the entire reference data in the prompt context.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Multi-Value Field Normalization Prompt works well and where it introduces risk. Use these cards to decide if this prompt fits your pipeline before you integrate it.

01

Good Fit: Delimited Lists from Legacy Systems

Use when: You are ingesting CSV exports, form dumps, or legacy database fields where multiple values are packed into a single column using a consistent delimiter. Guardrail: Provide the prompt with a sample of the raw input to confirm delimiter detection before processing the full batch.

02

Bad Fit: Unstructured Natural Language Lists

Avoid when: Values are embedded in prose (e.g., 'I need apples, bananas, and maybe oranges if they are ripe'). The prompt is designed for delimiter-separated fields, not semantic extraction from sentences. Guardrail: Route natural language inputs to an entity extraction prompt first, then normalize the extracted list.

03

Required Inputs

What you must provide: The raw multi-value string and the target delimiter for reassembly. Strongly recommended: A canonicalization rule or reference list for each value (e.g., trim, lowercase, map to ID). Without normalization rules, the prompt only splits and cleans, which may not be sufficient for downstream system contracts.

04

Operational Risk: Quoted Delimiter Ambiguity

What to watch: Inputs like 'San Jose, CA', 'Austin, TX' where the delimiter appears inside quoted values. The model may split on the comma inside the quotes, corrupting the data. Guardrail: Add a pre-processing step or explicit instruction to respect quoted blocks. Always log rows where the number of output values deviates from the expected schema for human review.

05

Operational Risk: Silent Deduplication

What to watch: The prompt deduplicates values by default, which can destroy intentional repeated entries (e.g., multiple identical line items). Guardrail: Make deduplication a configurable flag in the prompt instructions. If duplicates are meaningful, set deduplicate: false and handle uniqueness downstream in application logic.

06

Operational Risk: Inconsistent Whitespace Handling

What to watch: A value like ' high priority ' may be trimmed, but the original whitespace might carry meaning in certain legacy systems. Guardrail: Instruct the prompt to return both the normalized value and a boolean flag indicating if whitespace was modified, allowing the ingestion pipeline to audit changes.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for standardizing delimited multi-value fields before ingestion.

This prompt template handles the normalization of a single delimited field containing multiple values. It detects the delimiter, splits the values, trims whitespace, deduplicates, normalizes each value according to your rules, and reassembles the list with a target delimiter. The template is designed to be pasted directly into your prompt layer—replace each square-bracket placeholder with your specific configuration before sending to the model.

text
You are a data normalization engine. Your task is to standardize a multi-value field.

INPUT VALUE:
[INPUT_VALUE]

TARGET DELIMITER:
[TARGET_DELIMITER]

NORMALIZATION RULES:
[NORMALIZATION_RULES]

OUTPUT SCHEMA:
{
  "original_value": "string (the raw input)",
  "detected_delimiter": "string | null (the delimiter found: comma, semicolon, pipe, newline, tab, or null if single value)",
  "delimiter_confidence": "high | medium | low (confidence in delimiter detection)",
  "value_count": "integer (number of values after splitting)",
  "normalized_values": ["string"],
  "deduplicated": "boolean (whether duplicates were removed)",
  "parsing_ambiguities": ["string"] (list of any issues found, empty if none),
  "reassembled": "string (values joined with target delimiter)"
}

CONSTRAINTS:
- Detect the delimiter by analyzing the input. Common delimiters: comma, semicolon, pipe (|), newline, tab.
- If values are quoted (single or double), respect the quoting: do not split on delimiters inside quotes.
- Trim leading and trailing whitespace from each value after splitting.
- Remove exact duplicate values after trimming (case-sensitive deduplication by default).
- Apply the normalization rules to each individual value.
- Reassemble the normalized, deduplicated values using the target delimiter.
- Flag any parsing ambiguities: mixed delimiters, unbalanced quotes, empty values after trimming, delimiter appearing inside unquoted values.
- If no delimiter is detected, treat the entire input as a single value.
- Do not invent values. Do not fill gaps with assumptions.

EXAMPLES:
[EXAMPLES]

Return ONLY valid JSON. No markdown fences, no commentary.

To adapt this template, replace [INPUT_VALUE] with the raw field content, [TARGET_DELIMITER] with your desired output delimiter (e.g., , , ;, |), and [NORMALIZATION_RULES] with field-specific instructions such as 'lowercase all values', 'convert state abbreviations to full names', or 'map to canonical category codes'. The [EXAMPLES] placeholder should contain 2–4 few-shot demonstrations showing edge cases like quoted values containing delimiters, mixed delimiters, and duplicate detection. For high-risk ingestion pipelines, add a [RISK_LEVEL] placeholder that triggers additional validation flags or human-review routing when confidence is low.

Before deploying, validate the output JSON against your schema in the application layer. Common failure modes include the model missing a delimiter inside quoted values, normalizing values that should remain as-is, or failing to flag ambiguous inputs. Run this prompt against a golden test set that includes single values, empty strings, quoted delimiters, mixed delimiters, and near-duplicate values (e.g., trailing whitespace differences) to confirm the deduplication and trimming behavior matches your expectations.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the multi-value field normalization prompt. Wire these placeholders into your ETL pipeline or normalization harness before calling the model.

PlaceholderPurposeExampleValidation Notes

[RAW_FIELD_VALUE]

The raw delimited string to normalize

apple; banana; cherry; apple

Required. Must be a non-null string. Empty string is valid and should return an empty normalized list.

[TARGET_DELIMITER]

The delimiter to use in the normalized output

,

Required. Must be a single character or escape sequence like \t. Validate length equals 1 before prompt assembly.

[DETECTED_DELIMITER_HINT]

Optional pre-detected delimiter to reduce ambiguity

;

Optional. If null, the prompt must auto-detect. If provided, validate it is a single character. Useful when upstream parsing already identified the delimiter.

[NORMALIZATION_RULES]

Per-value transformation rules to apply after splitting

lowercase, trim, strip diacritics

Required. Provide as a list of rule names or a structured object. Validate against allowed rule set: trim, lowercase, uppercase, titlecase, strip_diacritics, remove_punctuation, null.

[DEDUPLICATION_FLAG]

Whether to remove duplicate values after normalization

Required. Must be boolean true or false. If false, preserve original order and duplicates. If true, remove exact-match duplicates after normalization.

[SORT_ORDER]

Optional sort direction for normalized output

ascending

Optional. Allowed values: ascending, descending, preserve_original, null. If null or preserve_original, maintain split order after deduplication.

[QUOTE_HANDLING_MODE]

How to handle quoted values containing delimiter characters

split_and_unquote

Required. Allowed values: split_and_unquote, preserve_quotes, error_on_quotes. split_and_unquote removes surrounding quotes after splitting. preserve_quotes keeps quotes in values. error_on_quotes flags the record for human review.

[AMBIGUITY_THRESHOLD]

Confidence threshold below which the record is flagged for review

0.85

Optional. Float between 0.0 and 1.0. If the model's delimiter detection confidence falls below this threshold, the output should include an ambiguity flag and the raw value should be routed to a review queue.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the multi-value field normalization prompt into a production ETL pipeline with validation, retries, and audit logging.

This prompt is designed to be called as a single step within a broader data normalization pipeline. It expects a raw delimited string and a target delimiter, and it returns a structured JSON payload containing the normalized list, the detected source delimiter, and any parsing flags. The implementation harness should treat this prompt as a deterministic transformation function: same input and configuration should produce the same output. Therefore, set the model temperature to 0 and, where the provider supports it, use a structured output mode (e.g., JSON mode or function calling with a strict schema) to prevent the model from wrapping the result in explanatory text.

Before calling the prompt, the application layer should perform lightweight pre-validation: reject null or entirely empty inputs without wasting an API call, and check that the input string length is within the model's context window. After receiving the model's response, validate the JSON structure against the expected schema. Confirm that normalized_values is an array, that source_delimiter is a single character or the string 'mixed', and that parsing_flags is an array of known flag strings. If validation fails, implement a single retry with the error message appended to the prompt as a correction instruction. If the retry also fails, route the record to a dead-letter queue for human review rather than silently ingesting malformed data.

Logging and audit trail generation are critical for this workflow because delimiter detection can be ambiguous. For every record processed, store the original input, the detected delimiter, the normalized output array, and any parsing flags in an immutable audit log. This is especially important when the prompt flags ambiguous_delimiter or quoted_delimiter_conflict. Downstream systems consuming the normalized values should have access to these flags so they can decide whether to trust the split automatically or escalate for manual verification. For high-volume pipelines, consider batching multiple records into a single prompt call with clear record separators to reduce API overhead, but ensure each record's output is independently validatable.

Model choice matters here. This task requires precise instruction-following and structured output generation, not creative reasoning. Smaller, faster models (such as GPT-4o-mini, Claude Haiku, or Gemini Flash) are usually sufficient and will reduce cost and latency. Avoid models that are prone to adding conversational filler or refusing straightforward text-processing tasks. If your pipeline processes data that may contain PII or sensitive business information, ensure the model endpoint is configured for zero-data-retention and that your API calls do not log request payloads to observability tools that lack data masking. For on-premise or air-gapped deployments, this prompt works well with open-weight models that support structured output, but you should validate delimiter detection accuracy on a representative sample of your actual data before committing to a model.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the shape, types, and validation rules for the normalized multi-value output. Use this contract to build a parser that validates the model response before downstream ingestion.

Field or ElementType or FormatRequiredValidation Rule

normalized_values

Array of strings

Must be a JSON array. Each element must be a non-empty string after trimming. Array must not contain duplicate values (case-sensitive check).

normalized_values[*]

String

Must match the normalization rules applied to individual values: trimmed, case-normalized per [CASE_RULE], and free of the original delimiter character.

target_delimiter

String

Must be exactly one character long. Must match the [TARGET_DELIMITER] input parameter. If input parameter is empty or null, default to comma ','.

reassembled_string

String

Must be the result of joining all elements in 'normalized_values' with the 'target_delimiter'. A simple concatenation check: normalized_values.join(target_delimiter) must equal this field.

original_count

Integer

Must be a non-negative integer representing the number of values detected after the initial split of [INPUT_STRING]. Must be greater than or equal to the length of 'normalized_values'.

normalized_count

Integer

Must be a non-negative integer exactly equal to the length of the 'normalized_values' array. A schema check: len(normalized_values) == normalized_count.

parsing_warnings

Array of objects or null

If non-null, each object must have 'type' (string enum: 'QUOTED_DELIMITER', 'AMBIGUOUS_SPLIT', 'EMPTY_VALUE_DROPPED') and 'position' (integer index in original split). If null, the array must be empty, not absent.

confidence

String enum

Must be one of: 'HIGH', 'MEDIUM', 'LOW'. If 'parsing_warnings' is not null and contains any entry, confidence must be 'MEDIUM' or 'LOW'. If 'original_count' is 0, confidence must be 'HIGH'.

PRACTICAL GUARDRAILS

Common Failure Modes

Multi-value field normalization breaks in predictable ways. These are the most common failure modes and how to guard against them before they reach production.

01

Delimiter Collision Inside Quoted Values

What to watch: The prompt splits on commas but fails to respect quoted substrings like "San Francisco, CA", producing broken fragments. Guardrail: Add an explicit instruction to detect and respect quote-wrapped values before splitting. Include a pre-pass that identifies quoted regions and treats them as atomic tokens during delimiter splitting.

02

Inconsistent Delimiter Detection

What to watch: The input uses semicolons but the prompt defaults to comma splitting, or a mixed-delimiter field (commas and pipes) causes partial splits. Guardrail: Require the prompt to explicitly detect the dominant delimiter before splitting. Add a validation step that counts delimiter frequency and flags inputs with multiple competing delimiters for human review.

03

Silent Deduplication of Near-Duplicates

What to watch: Values like "ACME Corp" and "ACME Corp." are treated as distinct after trimming but should be the same entity. The prompt deduplicates exact matches only, leaving near-duplicates in the output. Guardrail: Add a normalization sub-step before deduplication that lowercases, strips punctuation, and collapses whitespace. Flag near-duplicate pairs in the output with a confidence note rather than silently keeping both.

04

Trailing Delimiter Creates Empty Values

What to watch: Inputs like "red, blue, green," produce an empty string as a fourth value after splitting. Guardrail: Add a post-split filter that removes empty or whitespace-only entries before normalization. Include a flag in the output metadata indicating whether empty values were dropped so downstream consumers can audit the decision.

05

Normalization Rule Drift Across Values

What to watch: The prompt applies casing or formatting rules inconsistently—some values get title-cased while others remain lowercase because the model loses track of the rule mid-output. Guardrail: Structure the prompt to apply normalization in a separate, explicit pass after splitting. Use a bulleted rule list and require the model to confirm each rule was applied to every value before reassembly.

06

Target Delimiter Conflicts with Normalized Values

What to watch: After normalization, a value contains the target delimiter character (e.g., a pipe in a name like "A|B Testing" when reassembling with pipes). The output becomes unparseable downstream. Guardrail: Add an escape or quoting rule for the target delimiter. If the target delimiter appears in any normalized value, wrap that value in quotes or switch to a less common delimiter and annotate the change in output metadata.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Multi-Value Field Normalization Prompt before deploying it to a production ETL pipeline. Each criterion targets a specific failure mode common in delimiter detection, value splitting, and reassembly.

CriterionPass StandardFailure SignalTest Method

Delimiter Detection Accuracy

Correctly identifies the primary delimiter in a sample of 50 mixed-delimiter strings (comma, semicolon, pipe, newline) with >95% accuracy.

Prompt defaults to comma when a semicolon or pipe is the actual delimiter, or misinterprets a quoted comma as a delimiter.

Run a golden set of 50 [INPUT] strings with known delimiters. Assert detected delimiter matches expected. Log mismatches for review.

Quoted Value Integrity

Preserves values containing the delimiter when wrapped in double quotes. Does not split 'San Jose, CA' into two values.

A quoted string like '"Austin, TX"' is split into 'Austin' and 'TX'. The output contains more values than expected.

Include 10 [INPUT] strings with quoted substrings containing the target delimiter. Assert the output array length matches the expected number of logical values.

Whitespace Trimming and Collapsing

Each normalized value has no leading/trailing whitespace and no internal double spaces. ' red ' becomes 'red'.

Output contains values like ' red' or 'blue green'. Downstream unique constraints fail due to whitespace variance.

Parse the output array. For each value, assert value === value.trim() and value !== value.replace(/\s{2,}/g, ' '). Flag any failures.

Deduplication Logic

The output array contains no duplicate values after normalization. 'Red, red, RED' becomes ['Red'].

Output array contains ['Red', 'red', 'RED']. Downstream systems treat these as distinct categories.

Provide [INPUT] with intentional case and whitespace duplicates. Assert new Set(output).size === output.length. Check case-insensitive deduplication if specified in [CONSTRAINTS].

Target Delimiter Reassembly

The final output string uses exactly the delimiter specified in [TARGET_DELIMITER]. No trailing delimiter is present.

Output uses the original delimiter instead of the target, or appends a trailing delimiter like 'value1,value2,'.

Assert the output string ends with a normalized value, not the target delimiter. Split by [TARGET_DELIMITER] and verify the resulting array matches the normalized value array.

Empty and Null Input Handling

Returns an empty array or a null-safe placeholder as specified in [OUTPUT_SCHEMA] when [INPUT] is null, undefined, or an empty string.

Prompt returns a string containing 'null', 'undefined', or a single empty string value that passes validation but corrupts downstream aggregations.

Pass null, "", and a whitespace-only string as [INPUT]. Assert the output matches the null contract defined in [OUTPUT_SCHEMA] exactly.

Ambiguity Flagging

When two delimiters have equal frequency or a parsing conflict exists, the output includes a non-null ambiguity_flag field with a reason.

The prompt silently picks a delimiter and returns ambiguity_flag: null for a string like 'a,b;c,d'. The error is discovered only after data corruption.

Feed [INPUT] strings with tied delimiter frequencies. Assert output.ambiguity_flag is not null and contains a descriptive reason string.

Normalization Rule Application

Applies case normalization, synonym mapping, or other rules from [NORMALIZATION_RULES] to each value. 'usa' becomes 'US' if a rule exists.

Values pass through without transformation. 'usa' remains 'usa' despite a rule mapping it to 'US'.

Provide a [NORMALIZATION_RULES] mapping and an [INPUT] with values that must be transformed. Assert each output value matches its expected canonical form.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single example and minimal validation. Focus on delimiter detection and basic split/trim/deduplicate logic. Accept the model's default output format without strict schema enforcement.

code
Normalize the following delimited field into a pipe-separated list.
Trim whitespace, remove duplicates, and sort alphabetically.

Input: [RAW_FIELD_VALUE]

Watch for

  • Quoted values containing the delimiter being split incorrectly
  • Inconsistent whitespace handling around delimiters
  • No confidence flags when delimiter is ambiguous
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.