Here is an example, i have used template nodes to simulate file in nodes. Just replace them with file nodes. I have used JSONata in change nodes, but you could also use function nodes and some JS
[{"id":"6061496d.94985","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":2160,"wires":[["ba156bbd.57e338"]]},{"id":"ba156bbd.57e338","type":"template","z":"8d22ae29.7df6d","name":"read file master","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"one\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\nten","output":"str","x":320,"y":2160,"wires":[["418e378f.12ae8"]]},{"id":"418e378f.12ae8","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"master","pt":"msg","to":"$split(payload,\"\\n\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2160,"wires":[["a626ae2b.a2fcc8"]]},{"id":"a626ae2b.a2fcc8","type":"template","z":"8d22ae29.7df6d","name":"read file slave","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"one\nthree\nfive\nseven\nnine","output":"str","x":180,"y":2220,"wires":[["9a94bc4a.af7d8"]]},{"id":"9a94bc4a.af7d8","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"slave","pt":"msg","to":"$split(payload,\"\\n\")","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"$join($filter( master, function($v){$not($v in slave)} ),\"\\n\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":2220,"wires":[["ffd491fb.4123b8"]]},{"id":"ffd491fb.4123b8","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":2220,"wires":[]}]