Icon

Import CSV File - KNIME Forum (75783)

There has been no title set for this workflow's metadata.

Import CSV file and change column headers based on one Row - KNIME Forum (75783)

https://forum.knime.com/t/problem-reading-csv-file/75783/3?u=mlauber71

URL: Import CSV file and change column headers based on one Row - KNIME Forum (75783) https://forum.knime.com/t/problem-reading-csv-file/75783/3?u=mlauber71
URL: HUB: Import CSV - This workflow will act as a meta workflow trying to answer questions about importing data from CSV and Text files https://hub.knime.com/-/spaces/-/~ZupbtVwUDv43lAR7/current-state/

import knime.scripting.io as knio


import numpy as np

import pandas as pd



# Replace 'your_file.csv' with the path to your CSV file

file_path = knio.flow_variables["context.workflow.data-path"] + "ship_V6.csv"


# Read the CSV file into a DataFrame

df = pd.read_csv(file_path, sep=';')


# Display the first few rows of the DataFrame

# print(df.head())


knio.output_tables[0] = knio.Table.from_pandas(df)

Import CSV file and change column headers based on one Row - KNIME Forum (75783)

https://forum.knime.com/t/problem-reading-csv-file/75783/3?u=mlauber71

locate and create /data/ folder with absolute paths
Collect Local Metadata
CSV Reader
exclude Row with columnnames
Reference Row Filter
R Source (Table)
Table Transposer
result.table
Table Writer
change columnnames
Column Renamer (Dictionary)
Column Auto Type Cast
Python Script
filter Row withColumn Names
Row Filter

Nodes

Extensions

Links