Reading part of csv file

#1

Another newbie question. How do I read only part of a csv file, say the last 10 lines? File node reads the whole file, and tail only the last. There must be a simple way!

0 Likes

#2

tail -n 10 filename.csv in an exec node should return the last 10 lines.

0 Likes

#3

Thanks @JayDickson that is working. Are there extra parameters I can use to better format the string and separate the lines when using text node on dashboard?

0 Likes

#4

If you can add the header row back on, you can simply use the csv node to turn it into JSON.

0 Likes

#5

I'm sure you're right @TotallyInformation but can you explain what that means?!

0 Likes

#6

The first row of a csv generally defines the column/field structure. Though I seem to remember you can supply this separately in the CSV node. So perhaps you don’t need to do anything other than define the columns.

The rest of the answer is provided by Jay’s tail response.

0 Likes

#7

ok, yes the tail works fine. My csv doesn't have (or need) any headers, and I don't mind the commas in the text, but I do need each line to display as separate lines. Thanks.

0 Likes