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?

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?

As in have joins based on the sensor type

Columns after the transform.

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