Does anyone here know how to make a header and footer for a .txt file in xano?

Options

I'm planning on creating a file resource (.txt) that has a sample format like this:

HEADER 00000001

DETAILS/NAME/MMDDYYYY

FOOTER 00000001

The details' data will be taken from a table while the header and footer are separately saved in a DB.

Another thing, is it possible to create a file name sequence number that increments whenever a new file is added? Example, file name is FILE000001.txt, the next file on the list would be FILE000002.txt


Any suggestions would be highly appreciated. Thank you in advance!

Best Answer

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Answer ✓
    Options

    @chrstnstl - you can definitely do the incremental filename with a little help from filters. If you are able to go to the DB to get the previous file name, you can use a filter like substr (or even the trim filters) to extract the integer from the text. Then increment the integer by 1 and update the original text string with the new value.