Format a CSV Inventory File
Inventory management is one of the most data-intensive operations in e-commerce and retail, and CSV files are the standard exchange format between warehouse management systems, ERP platforms, e-commerce storefronts, and procurement systems. An inventory CSV that's incorrectly imported can result in overselling out-of-stock products, failing to trigger reorders at the right thresholds, or pricing products at the wrong cost — all of which have direct financial consequences. This example shows an inventory file with nine columns that represent the key metrics every inventory system needs. The SKU (Stock Keeping Unit) is the unique product identifier that links inventory records to product catalog records. in_stock is the total physical quantity in the warehouse. reserved is the quantity committed to pending orders that haven't shipped yet. available = in_stock - reserved is the quantity that can actually be sold to new customers. reorder_point is the available quantity threshold below which a purchase order should be placed. cost is what you paid for each unit; price is what you charge customers. The Desk Lamp row (LAMP-500) demonstrates the most critical inventory scenario: in_stock is 0, which means this product is completely out of stock and should be marked as unavailable or hidden from the storefront. Systems that rely on available > 0 rather than in_stock > 0 might still show the product as available if there were reserved units, which would lead to order acceptance for a product that cannot be shipped. The Monitor Stand (MS-300) is in a different critical state: available is 3 but reorder_point is 8, meaning this product is below its reorder threshold. Filtering for WHERE available < reorder_point in a spreadsheet or database query surfaces all products that need purchasing attention, which is one of the most valuable operational queries from an inventory dataset. Column count validation is critical: if any row has fewer or more comma-separated values than the header row, it indicates a data quality problem — usually caused by product names or descriptions that contain unescaped commas. The CSV viewer highlights rows with inconsistent column counts, which would cause silent data corruption in an import script that assumes column positions. Real-world workflow: a procurement script runs nightly, queries the inventory CSV, identifies all products where available < reorder_point, and automatically creates draft purchase orders in the procurement system. The CFO reviews and approves draft orders each morning. Tips: always include the SKU as the first column since it's the primary key that all other systems reference. Use consistent zero-padded numbers (MS-300 not MS-3) to ensure correct alphabetical sorting and to prevent partial-match confusion in search.
sku,name,category,in_stock,reserved,available,reorder_point,cost,price KB-100,Wireless Keyboard,Electronics,45,5,40,10,32.00,79.99 HUB-200,USB-C Hub,Electronics,12,2,10,5,18.00,49.99 MS-300,Monitor Stand,Furniture,3,0,3,8,12.00,34.99 LAMP-500,Desk Lamp,Furniture,0,0,0,5,10.00,28.99 CAM-400,Webcam 1080p,Electronics,28,4,24,10,35.00,89.99
FAQ
- What is the difference between in_stock and available?
- in_stock is the total quantity in the warehouse. reserved is stock committed to pending orders. available = in_stock - reserved, representing what can still be ordered.
- How do I find products below their reorder point?
- In a spreadsheet use a formula like =IF(available<reorder_point,"Reorder","OK"). In SQL, use WHERE available < reorder_point after importing the CSV.
- How do I update inventory from a CSV file?
- Use the CSV to SQL INSERT or UPSERT converter to generate SQL from the file. Most inventory systems also provide direct CSV import functionality in their admin UI.
Related Examples
Sales data is the lifeblood of e-commerce and retail analytics, and CSV is the u...
Format a CSV Financial StatementFinancial data is among the most consequential data that passes through CSV file...
Format a CSV User ListUser data exports are one of the most frequently created and consumed CSV files ...