Remove the two footer lines from a stock export (hardware)
The export tool appends two summary lines at the bottom of every file. Remove them, then type the counts.
- Level
- beginner
- Time
- ~6 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Remove trailer rows that an export adds, before typing the data.
Tinker Depot (fictional) runs two warehouses for hardware supplies and exports stock levels nightly.
Steps
StockFileis a comma-separated file with a header row. Its last two lines are always a footer (they start with--).- Use the first row as headers, remove the two footer rows, then set
OnHandto a whole number (en-US). - Output
SKU,Item,OnHand.
Your result must
- No footer rows
- Every stock row kept
- OnHand is a whole number without errors
Input
- StockFile (file)
- Text file; first line: SKU,Item,OnHand
- Every field is text until you set types
Expected output columns
SKU (text), Item (text), OnHand (number)
| SKU | Item | OnHand |
|---|---|---|
| SKU-001 | Sandpaper | 109 |
| SKU-002 | Sandpaper | 138 |
| SKU-003 | Hinge | 117 |