tableToKeyValues function out of GMod

Hi,

can anyone write me a function that takes a table and writes it to a file with the same syntax as util.TableToKeyValues? I need this outside of GMod because I have a txt file I need to process, but since in-gmod lua gives infinite loop error I need to do it outside of GMod, and I therefore need this function :slight_smile:

If anyone can do this I will be ever so thankful.