MQTT Save String Payload to File

Hi Guys

I have setup MQTT Broker and have it running.

I want to send a payload of a MAC Address to the Broker that have been scanned via Bluetooth & WiFi.

Once the Broker receives this payload, how do I save the MAC Address’s to a file to be able to view via Lovelace?

Ideally, I would like a table an be able to edit a label for each MAC Address.

NOTE: I am using Node-Red.