I'm trying an experiment that consists of ingesting a text file that has numbered questions and answers in the following format:
1.) Question : Answer
2.) Question : Answer
I'm able to read the TXT file using the LOAD CSV function just fine. I can separate the answer from the question with the SPLIT function (e.g., split(row, ':') as newrow. The question is how can I do a second split to extract just the question number as well? I tried the following:
unwind(row) as newrow
with split(newrow, ':') as myrow
unwind(myrow) as thisrow
with myrow, split(thisrow, ".)") as q
return q, myrow, myrow
But I seem to be looping within myrow constraints as I get q returning with the question number & question, then the answer in the next row, etc.
Any suggestions? I would really like to separate out the actual question number and then the answer to further build the graph. The question text doesn't really matter (consistent number and questions).