Lesson 2 of 10 · Lab
Load a CSV file into a data flow
Input with Local File loads a file from your computer and chooses a type for each column, such as number or text. Check what it chose before you calculate, because a column of amounts can arrive as text.
This lesson runs in Strata, Oplema's browser app for data prep, rather than in this page, so you need a desktop browser. You don't need an account.
Tomas, who manages Harbour at fictional Kramerica Bikes, won't post next week's export anywhere. He'll email it, so you'll load it from your computer. Practice on the same file: kramerica-harbour-to-sep-20.csv.
bikes holds 1, 2 and 3. amount holds 24,50 and gratis. Which will Input read as numbers?
Only bikes. Input reads a period as the decimal point unless you tell it otherwise, so 24,50 isn't a number to it, and gratis never is. One cell that isn't a number keeps the whole column as text.
Load Harbour's export in the Strata app
- Download kramerica-harbour-to-sep-20.csv.
- Open Strata. You see an empty canvas with a block palette above it.
- In the palette, select IO and drag Input onto the canvas, or double-click it.
- Select the block. Properties on the left shows Local File. Select Browse and choose the downloaded file, or drop it on the box beside Browse.
- The preview reads 100 rows × 12 columns. Open Preview: 100 rows and choose Preview: All rows: 321 rows × 12 columns, as in the last lesson.
- Read the small label under each column name in the preview.
bikessays BIGINT, a whole number.amountandhire_datesay VARCHAR, which is text. - The first row's
amountalready readsgratis. The threesee notecells inhire_datesit among the hires from14/09/2026on, and the first is about two-thirds of the way down.
What you should see
321 rows and 12 columns, the same table as the URL gave you. bikes is the only number; every other column is VARCHAR, including amount. Select Summary at the top of the preview to see every column's type in one list.
Why two columns stayed text
Input doesn't fail on a column it can't read as a number. It keeps it as text, and nothing turns red. A text amount can't be totaled until you turn it into a number, the European way.
hire_date is text only because staff typed see note for three hires from the paper pad. Without those three cells, Input would read 14/09/2026 as a date.
The Input reference covers the CSV settings, such as the separator. For later: Where data lives explains why so much data arrives as exports.
Common loading mistakes
- Opening the CSV in a spreadsheet first. Saving it again can change dates and amounts to your computer's settings. Load the file as it was sent.
- Trusting a type because nothing is red. Read the label under each column before you sum it.
- Loading a new file into the same block by mistake. Browse replaces the block's file, and every block after it changes too.
read_csv and Excel's From Text/CSV
SELECT * FROM read_csv('kramerica-harbour-to-sep-20.csv');
DESCRIBE SELECT * FROM read_csv('kramerica-harbour-to-sep-20.csv');DuckDB's read_csv also chooses each column's type from its values, and DESCRIBE lists them. In Excel, Data > From Text/CSV previews the types before it loads. Opening the file directly lets Excel convert 24,50 by your regional settings, so one file can read differently on two laptops.