Reading single row in csv file

Hi,

Is it possible to select and read a single row in a csv file?

I have a csv document with the text of all my alarms (automatic generated so that's why i start from this file source) and now i want only read the row with the corresponding alarm. So for example if my input for temperature alarm is high i want to read row 6 of the csv file and log it in a database.

I only find a way to read the whole file.

Thanks at advance!
Kind regards,
Ward

You don't have to read all the lines, just let them all be send and use a switch node to filter for your needs.

See this example flow:

[{"id":"73e5e95c.050fe8","type":"csv","z":"711169bd.c68438","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":434,"y":312,"wires":[["27bdaada.685e9e","7f507812.bf37d8"]]},{"id":"9a9ed6a0.88d5b8","type":"inject","z":"711169bd.c68438","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":154,"y":312,"wires":[["f1b006d3.ab7888"]]},{"id":"f1b006d3.ab7888","type":"function","z":"711169bd.c68438","name":"","func":"data = `date,temperature\n202008110900,20\n202008111000,26\n202008111100,25\n202008111200,27\n202008111300,21\n`\nreturn {payload:data};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":312,"wires":[["73e5e95c.050fe8"]]},{"id":"9916d5e5.46f21","type":"debug","z":"711169bd.c68438","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":838,"y":312,"wires":[]},{"id":"27bdaada.685e9e","type":"switch","z":"711169bd.c68438","name":"Temperature > 25 ?","property":"payload.temperature","propertyType":"msg","rules":[{"t":"gt","v":"25","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":618,"y":312,"wires":[["9916d5e5.46f21"]]},{"id":"7f507812.bf37d8","type":"debug","z":"711169bd.c68438","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":578,"y":240,"wires":[]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.