How to read a CSV file in Apache Hop
What this shows
Text File Input reads delimited files - CSV and anything shaped like it - and turns each line into a row with typed fields. It is usually the first transform in a pipeline.
Reference documentationThe complete list of Text File Input options is documented in the Apache Hop manual, which is the authoritative reference.hop.apache.org →Sample pipeline
The pipeline in the video is Apache Hop's own sample, textfileinput-basic.hpl, which ships in the Hop samples project under transforms/.
Transcript
Full transcript
Text File Input reads delimited files - CSV and anything shaped like it - and turns each line into a row with typed fields. It is usually the first transform in a pipeline.
This pipeline reads a small file of books and passes the rows straight through, so the whole lesson is in one dialog.
The File tab decides what to read. A directory plus a regular expression is often more useful than a single filename: point it at a folder and every file matching the pattern is read as one stream. Whatever you choose ends up in the Selected files table below.
Content is where you describe the shape of the file. The separator splits each line into fields, the enclosure protects separators that appear inside a value, and Header tells Hop to skip the first line rather than read it as data. These three settings account for most of the files you will meet.
Fields is where the file becomes typed data. Every field carries a name and a type, and that is what the rest of the pipeline sees. Get Fields reads a sample of the file and fills the table in for you - a starting point worth correcting by hand, because a column of digits is not always a number.
Running the pipeline reads the file from disk.
Eight rows, four fields each, exactly as the Fields tab described them. From here they are ordinary rows and nothing downstream needs to know they came from a file.