Creating a thread of nodes in Cypher load script

Let's say I have a Cypher Load script and each row defined a Node. I need to create a chain (a thread) of all these nodes link together.
*row1 creates a node *
row2 creates a new node, then connects the Previous Row1 Node to it.
row3 creates a new node and then connects Previous Row2 Node to it.
etc..
There must be a nice way to do this, right? script param holding the last node created ,or.. ? ??
Thanks Guys!

Is it always “current node links to previous row”? If so, you could create each node and collect them in a list, say nodeList. After which, create a list of integers with ‘range(1, size(nodeList)-1). Unwind the list of integers and access each pair of nodes to link with nodeList[i] and nodeList[i-1], use merge to create the relationship.

okay.. thanks.. I will give this a try.. if you have a pointer to an example that would help.. thanks GARY!! need to figure out how to do this "list" stuff .. :) .. thanks man!
Thanks Man.. thanks for your constant help.. wish I could do something for you.. sigh.

Here is an example:

Screen Shot 2024-03-18 at 2.27.47 PM

load csv with headers from "file:///Nodes.csv" as row
create (n:Person)
set n.id = toInteger(row.id), n.name = row.name
with collect(n) as nodes
unwind range(1,size(nodes)-1) as index
with nodes, index, nodes[index-1] as startNode, nodes[index] as endNode
merge(startNode)-[:REL]->(endNode)

thanks man.. just.. no time.. thanks.. I will blast away on this tonight.. thanks man

Anytime. You should get lack-of-sleep pay with the hours you keep.