Need help in loading csv file which has 9 header lines and then table starts

I have the following csv file format which I need to load into graph database.
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Overview,This report contains the questions and answers employees received during the selected date range.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Applied Filter 1,Deactivated Users Included,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Applied Filter 2,On Leave Users Included,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Name of the template,FY24 July Give Feedback Anytime,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Start Date,05/01/2024,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
End Date,07/31/2024,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Cycle ID,Receiver Employee ID,Receiver First Name,Receiver Preferred Name,Receiver Last Name,Receiver Email,Receiver Department,Receiver Parent Department,Receiver Location,Receiver On Leave,Receiver Is Deactivated,Receiver Deactivation Date,Receiver Has Activated,Receiver Matrix Manager,Receiver custom_01,Receiver custom_02,Receiver custom_03,Receiver custom_04,Receiver custom_05,Receiver hire_date,Manager Employee ID,Manager First Name,Manager Preferred Name,Manager Last Name,Manager Email,Manager Department,Manager Parent Department,Manager Location,Manager On Leave,Manager Is Deactivated,Manager Deactivation Date,Manager Has Activated,Manager Matrix Manager,Manager custom_01,Manager custom_02,Manager custom_03,Manager custom_04,Manager custom_05,Manager hire_date,Second Level Leader Email,Top Level Leader Email,Provider Employee ID,Provider First Name,Provider Preferred Name,Provider Last Name,Provider Email,Provider Department,Provider Parent Department,Provider Location,Provider On Leave,Provider Is Deactivated,Provider Deactivation Date,Provider Has Activated,Provider Matrix Manager,Provider custom_01,Provider custom_02,Provider custom_03,Provider custom_04,Provider custom_05,Provider hire_date,Provider Has Answered,Created,Custom Note,Decline Reason,Question #1,Answer #1,Question #2,Answer #2,Question #3,Answer #3

There are 8 lines in the beginning after which the csv table starts. I need to extract the value of 2nd column from line 6 (FY 24 July Give Feedback Anytime) and use it as a property in all the nodes which will be created subsequently from the table below. Then I need to process the table from line 9 which is simple. I am not able to figure out how to do the first part using LOAD CSV. I went through the documentation but couldn't find any guidance.

If I understand correctly, Line 9 beginning with Cycle ID and ending at Answer #3 are the column headers. Actual data values are after the above header? Meaning column1 name is "Cycle ID" and the value in. column 1 corresponds to Cycle ID. .csv file should have headers in the first row and data values after that. This is the format that works with LOAD CSV.

Yes , you got that right. Is there no way to get the value of 2nd column from line 6 and skip other lines.

Option 1:

LOAD CSV WITH HEADERS FROM "file:///xxx.csv" AS row

with row, "FY24 July Give Feedback Anytime" as templateName and use templateName in the property of a node.

Option 2:

In your .csv file add a column as "Template Name" and store "FY24 July Give Feedback Anytime" as the value
use row.Template Name value and add it to a node property.

I am going to make the bold statement that your file is not a csv. Also, my guess this comes from exporting and excel sheet as csv?

Anyway, I would approach it this way (depending on the scenario).

Scenario 1 "one off data loading": Just clean up the csv to make it easy to work with. If the source is excel, try to tidy up the table in excel before exporting it.

Scenario 2 "more than one off": I would pick up another tool than LOAD CSV. Write a small python script etc. So I can do input validation and cure the "csv".

1 Like