cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Lots of Columns to convert

Hi yall,

I have a lot of columns (5144) to load into my graph and they are all of type Float. Is there a way to import them all as float apart from first column without having to toInteger(row[0]) for every single column?

4 REPLIES 4

Hello @Ahmad

For now, Cypher will misunderstand your csv file.

1- You would need to transpose it first, which is not a big deal. Any good spreadsheet reader have a transpose function. So your columns will become rows and rows columns.

2 - For all the columns except the first one ( You can select all of them at once with SHIFT + A and PRESS CTRL + the first Timestamp column to remove it from your selection in most spreadsheet readers ) apply a customised number format to your floats values such as x.xx depending of the floating point precision you need.

3 - You can then use apoc.load.csv procedure to important your data with automatic conversion.

Let me know if it doesn't work. According the the documentation automatic conversion will occur on your property. If not you can use the mapping option for your 7 columns concerned which is not that bad.

sorry for the late reply and thanks for the help!

  1. Why would I need to transpose? I want to do joins on the shared key of temperature, humidity, Dew point, etc to form my graph?

  2. are you talking about columns before or after the transform?

Columns after the transform.

Neo4j works with CSV files with the header as the first line of your csv file.

As in have joins based on the sensor type