Flat File Rejected? 10 Common Format Errors and How to Fix Them
Introduction
You've prepared your customs declaration, converted your Excel data, and uploaded your flat file to Dubai Trade - only to see that dreaded rejection message. Now your shipment is stuck, and you're scrambling to figure out what went wrong.
Flat file rejections are frustrating, but they're almost always caused by a handful of common errors. This guide identifies the 10 most frequent flat file problems and shows you exactly how to fix each one.
**Good News:** Once you understand these errors, they're easy to prevent. Most can be caught before upload with proper validation.
Error #1: Incorrect Field Length
**The Problem:**
Fields in flat files have specific length requirements. Too short or too long = rejection.
**Error Message Example:**
'Field 'HS_CODE' exceeds maximum length' or 'Field 'ITEM_NO' invalid format'
**Common Causes:**
- HS code not exactly 12 digits
- Text fields exceeding character limits
- Missing leading zeros in numeric fields
**Specific Requirements:**
- HS Code: Exactly 12 characters
- Item Number: Usually 3-4 digits
- Country Code: Exactly 2 characters (ISO)
- Description: Max 350-500 characters (varies)
**How to Fix:**
- Pad short fields: '123' → '0123'
- Truncate long fields (carefully - don't lose meaning)
- Use validation tools before upload
**Prevention:**
Use the [Flat File Converter](/convert) which automatically formats field lengths correctly.
Error #2: Invalid HS Code Format
**The Problem:**
HS codes that aren't exactly 12 numeric digits, or codes that don't exist in the UAE tariff.
**Error Message Example:**
'Invalid HS code format' or 'HS code not found in tariff'
**Common Causes:**
- Using 6 or 8 digit codes instead of 12
- Including dots, spaces, or dashes
- Outdated codes that have been discontinued
- Typos in code entry
**Examples of Invalid Codes:**
- '851712' (only 6 digits)
- '8517.12.10.00' (contains dots)
- '85171210 00' (contains space)
- '85171299999' (only 11 digits)
**Correct Format:**
- '851712100000' (exactly 12 numeric digits)
**How to Fix:**
1. Remove all non-numeric characters
2. Extend to 12 digits using [HS Code Converter](/)
3. Verify code exists in current UAE tariff
**Quick Check:** Every HS code must be exactly 12 digits, numbers only.
Error #3: Missing Mandatory Fields
**The Problem:**
Required fields are empty or contain only spaces.
**Error Message Example:**
'Mandatory field missing' or 'Required value not provided'
**Commonly Missing Fields:**
- Country of Origin
- Net Weight
- CIF Value
- Unit of Measure
- Item Description
**Common Causes:**
- Blank cells in Excel source
- Formulas returning empty strings
- Data not mapped to all required columns
- Copying partial data from templates
**How to Fix:**
1. Check all mandatory fields have values
2. Replace formula errors (#N/A, #REF!) with actual values
3. Fill placeholder values where allowed (e.g., 'N/A' for some text fields)
**Prevention Checklist:**
- [ ] HS Code present for all items
- [ ] Country of origin specified
- [ ] Quantity and unit entered
- [ ] Value declared
- [ ] Description provided
Error #4: Character Encoding Issues
**The Problem:**
Special characters, non-ASCII text, or wrong encoding breaks the file.
**Error Message Example:**
'Invalid character in field' or 'File encoding error'
**Problematic Characters:**
- Smart quotes: \u201c\u201d \u2018\u2019 → Use straight quotes: \" '
- Em/en dashes: — – → Use hyphen: -
- Non-English letters: é, ü, ñ, etc.
- Symbols: ®, ™, ©, €
- Line breaks within fields
- Tabs in text fields
**Common Sources:**
- Copy-paste from Word or PDFs
- Supplier descriptions with special characters
- Product names with trademark symbols
**How to Fix:**
1. Save file as plain text (ASCII or UTF-8 without BOM)
2. Replace special characters with ASCII equivalents
3. Remove hidden characters (line breaks, tabs)
**Quick Fix in Excel:**
- Use CLEAN() and TRIM() functions
- Find & Replace: Replace special characters with standard ones
Error #5: Incorrect Date Format
**The Problem:**
Dates not in the expected format (usually YYYYMMDD).
**Error Message Example:**
'Invalid date format' or 'Date field validation failed'
**Expected Format:**
- Dubai Trade typically expects: YYYYMMDD
- Example: February 11, 2026 → 20260211
**Common Wrong Formats:**
- '11/02/2026' (contains slashes)
- '02-11-2026' (wrong order, contains dashes)
- '11-Feb-26' (contains text)
- '2026/02/11' (contains slashes)
**Excel Date Issues:**
- Excel may display dates differently than stored
- Regional settings affect date display
- Text-formatted dates may not convert properly
**How to Fix:**
1. Format cells as text before entering dates
2. Use formula: =TEXT(A1,"YYYYMMDD")
3. Manual entry in YYYYMMDD format
**Dates to Check:**
- Invoice date
- Bill of lading date
- Arrival date
- Production date (if applicable)
Error #6: Numeric Value Format Errors
**The Problem:**
Numbers containing commas, currency symbols, or too many decimal places.
**Error Message Example:**
'Invalid numeric value' or 'Value format error'
**Common Issues:**
- Thousand separators: 1,000.00 → Should be 1000.00
- Currency symbols: AED 500 → Should be 500.00
- Too many decimals: 123.456789 → Should be 123.46
- Text mixed with numbers: '500 units' → Should be 500
**Field-Specific Requirements:**
- Value fields: Usually 2 decimal places
- Quantity: Integer or 2-3 decimals
- Weight: Usually 3 decimal places
**How to Fix:**
1. Remove thousand separators (commas)
2. Remove currency symbols
3. Round to required decimal places
4. Separate quantity from unit of measure
**Excel Tips:**
- Format cells as 'Number' not 'Currency'
- Use VALUE() function to convert text to numbers
- Set decimal places in cell format
Error #7: Row/Line Terminator Issues
**The Problem:**
Incorrect line endings or missing row separators.
**Error Message Example:**
'Unexpected end of line' or 'Row count mismatch'
**Technical Background:**
Different systems use different line endings:
- Windows: CR+LF (\r\n)
- Mac/Linux: LF (\n)
- Old Mac: CR (\r)
Dubai Trade typically expects Windows-style (CR+LF).
**Common Causes:**
- File created on Mac/Linux
- Text editor changed line endings
- Copy-paste from different systems
- Line breaks within text fields
**How to Fix:**
1. Open in Notepad++ → Edit → EOL Conversion → Windows
2. In Excel: Save as 'CSV (Windows)'
3. Use text editor to find/replace line endings
**Prevention:**
- Always save from Windows if possible
- Use validated converter tools
- Check file in text editor before upload
Error #8: Field Delimiter Problems
**The Problem:**
Delimiters (separators between fields) are wrong or inconsistent.
**Error Message Example:**
'Field count mismatch' or 'Invalid field delimiter'
**Common Delimiter Issues:**
- Using commas when tabs required (or vice versa)
- Delimiter character appearing in data
- Missing delimiters between fields
- Extra delimiters creating empty columns
**Example Problem:**
Data: 'T-shirts, cotton, medium'
If comma is delimiter, this becomes 3 fields instead of 1.
**Solutions:**
- Use text qualifiers: "T-shirts, cotton, medium" (quotes protect commas)
- Replace commas in data with semicolons
- Use tab-delimited format (commas in data won't affect)
**How to Check:**
1. Open flat file in text editor
2. Verify consistent delimiter throughout
3. Count fields per row (should be same for all)
**The Flat File Converter handles this automatically.**
Error #9: Header Row Mismatch
**The Problem:**
Header row doesn't match expected format, or data rows are being treated as headers.
**Error Message Example:**
'Unknown column header' or 'Required header missing'
**Common Causes:**
- Misspelled column headers
- Extra spaces in header names
- Case sensitivity issues
- Missing required column headers
- Extra header rows
**Expected vs Common Mistakes:**
- 'HS_CODE' vs 'HS CODE' vs 'HSCode' vs 'hs_code'
- 'COUNTRY_ORIGIN' vs 'Country of Origin'
**How to Fix:**
1. Get exact header format from Dubai Trade documentation
2. Copy-paste headers from a working template
3. Remove extra spaces (TRIM)
4. Match exact case requirements
**Best Practice:**
- Keep a validated header template
- Never manually type headers - copy from known good file
- Test with small dataset first
Error #10: Duplicate or Invalid Reference Numbers
**The Problem:**
Item numbers, reference numbers, or identifiers are duplicated or invalid.
**Error Message Example:**
'Duplicate item number' or 'Invalid reference format'
**Common Issues:**
- Same item number used twice
- Item numbers out of sequence
- Reference number format incorrect
- Permit numbers that don't validate
**Item Number Rules:**
- Must be unique within declaration
- Usually sequential (001, 002, 003...)
- Format requirements vary (sometimes numeric only)
**How to Fix:**
1. Re-sequence item numbers
2. Check for copy-paste duplicates
3. Verify permit numbers exist and are valid
4. Ensure reference numbers match required format
**Prevention:**
- Use auto-numbering formulas in Excel
- Validate against permit system before upload
- Run duplicate check before export
How to Validate Before Upload
**Pre-Upload Checklist:**
**1. Field Format Check:**
- [ ] All HS codes are 12 digits
- [ ] Dates are in YYYYMMDD format
- [ ] Numbers have no commas or currency symbols
- [ ] Text fields within length limits
**2. Completeness Check:**
- [ ] All mandatory fields populated
- [ ] No blank rows between data
- [ ] Header row matches expected format
**3. Consistency Check:**
- [ ] Item numbers are unique
- [ ] All rows have same number of fields
- [ ] No extra delimiters in data
**4. Encoding Check:**
- [ ] No special characters
- [ ] Correct line endings
- [ ] File opens correctly in text editor
**Validation Tools:**
- Use [CustomsEZ Flat File Converter](/convert) for automatic validation
- Preview file in text editor before upload
- Test with single-item file first
Conclusion
Flat file rejections are frustrating but predictable. The same 10 errors cause the vast majority of upload failures. Once you understand these patterns, you can prevent them.
**Summary of 10 Common Errors:**
1. Incorrect field length
2. Invalid HS code format
3. Missing mandatory fields
4. Character encoding issues
5. Wrong date format
6. Numeric value format errors
7. Row/line terminator issues
8. Field delimiter problems
9. Header row mismatch
10. Duplicate reference numbers
**Best Prevention Strategy:**
Use validated conversion tools rather than manual formatting. The [Flat File Converter](/convert) automatically handles most of these issues.
**When You Get a Rejection:**
1. Read the error message carefully
2. Identify which error type it matches
3. Apply the specific fix
4. Validate before re-uploading
**Save Time:** Convert your files with [CustomsEZ Flat File Converter](/convert) and avoid these errors entirely.
Ready to Get Started?
Convert your Excel files to Dubai Trade flat file format.
Also helpful for this topic:
Related Guides
What is Dubai Trade Flat File Format? Complete Guide
Everything you need to know about Dubai Trade flat file format. Learn how to create, validate, and submit flat files for customs declarations.
How to Use Your Excel to Prepare an Upload-Ready Flat File for Dubai Customs
Complete guide to converting your Excel product list into a Dubai Customs-ready flat file. Learn how to handle both 8-digit and 12-digit HS codes during the UAE transition period.
Dubai Trade Portal Tutorial: Step-by-Step Guide for Beginners
Complete Dubai Trade portal tutorial for importers and exporters. Learn how to register, submit declarations, and track shipments online.
