Import a semicolon-separated stock file (hardware)
Read a CSV that uses semicolons, promote headers and set number types.
- Level
- beginner
- Time
- ~7 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Import delimited text with the right delimiter, then promote headers and type the columns.
Tinker Depot (fictional) runs two warehouses for hardware supplies and exports stock levels nightly.
Steps
- The file uses
;as its delimiter. Make sure each field lands in its own column. - Use the first row as headers.
- Set
OnHandandReorderLevelto whole numbers andUnitCostto a decimal number (en-US).
Your result must
- Seven columns: SKU, Item, Warehouse, OnHand, ReorderLevel, Supplier, UnitCost
- Numbers are numbers, not text
- Works on tomorrow's file
Input
- StockFile (file)
- Text file; first line: SKU;Item;Warehouse;OnHand;ReorderLevel;Supplier;UnitCost
- Every field is text until you set types
Expected output columns
SKU (text), Item (text), Warehouse (text), OnHand (number), ReorderLevel (number), Supplier (text), UnitCost (number)
| SKU | Item | Warehouse | OnHand | ReorderLevel | Supplier | UnitCost |
|---|---|---|---|---|---|---|
| SKU-001 | Drill Bit | WH-A | 57 | 25 | Grainline | 30.65 |
| SKU-002 | Drill Bit | WH-B | 49 | 10 | Grainline | 18.58 |
| SKU-003 | Sandpaper | WH-A | 70 | 20 | Bolt & Co | 3.06 |