Icon

Exercise1

<p><strong>Chapter 2/Exercise 1</strong></p><p>This exercise shows how to read a <em>.txt</em> file using the CSV Reader node. The <em>data1.txt</em> file has a header with comments which we don't want to read. The workflow is showing two methods on how to apply advanced file reading features to exclude the comment header from the data:</p><ol><li><p>CSV Reader with "Support short data rows" enabled and "Skip first 5 data rows" in "Limit Rows" tab</p></li><li><p>CSV Reader with only "Support short data rows" enabled and subsequent Row Filter to remove first 5 spurious rows</p></li></ol><p>It then apply a Column Filter to clean the data and writes it to a <em>.csv</em> file.<br><br></p>

URL: KNIME Beginner's Luck (Book Homepage) https://www.knime.com/knimepress/beginners-luck

Annotations and comments
  • Workflow: Chapter 2/Exercise 1 This exercise shows how to read a .txt file using the CSV Reader node. The data1.txt file has a header with comments which we don't want to read. The workflow is showing two methods on how to apply advanced file reading features to exclude the comment header from the data: CSV Reader with "Support short data rows" enabled and "Skip first 5 data rows" in "Limit Rows" tab CSV Reader with only "Support short data rows" enabled and subsequent Row Filter to remove first 5 spurious rows It then apply a Column Filter to clean the data and writes it to a .csv file.
  • Reading data
  • Cleaning data
  • Writing data
  • data1.txt "support short rows" enabled skip first 5 rows rename "ranking" into "marks"
  • data1.txt only "support short rows" enabled rename "ranking" into "marks"
  • Write to new file with column headers
  • Exclude column <class>
  • Exclude first 5 rows

Nodes

Extensions

Links