0

How to modify the view of the file .txt created with createTextFile ?

createTextFile(this, 'Name' + Surname, "prova.txt") 

This is the formula I am using right now but in the txt file I will see the information like: Mario Rossi 
I need to make the two information one under the other like: 
Mario 
Rossi. 

Is there any way to put a break string between the two information ? 

Thankyou! 

6 replies

null
    • Sean
    • 4 yrs ago
    • Reported - view

    Insert a "return" in the formula...

     

    createTextFile(this, Name + "
    " + Surname, "prova.txt")

    • vacunasrls
    • 4 yrs ago
    • Reported - view

    Can I ask your help one more time ? 

    I have created the file.txt with a precise number of characters (using rpad) and it should corrispond to the same number of byte of the size of the file (500 characters = 500 byte), but my file size is always bigger than the number of characters ( 508 characters = 722 byte).  I have done some tests and it seems that the white spaces are bigger then 1 byte. ( 200 letters + 308 white spaces  = 200 byte + 522 byte). 

    How this is possible and what can I do to make it 1=1 ? 

    Thank you for your help! 

    • Sean
    • 4 yrs ago
    • Reported - view

    I can only tell you what I know from testing. A regular space only requires one byte, but a non-breaking space (option+space) requires two bytes in a text file. I tested it by creating a text file with Ninox and with TextEdit on my Mac and they produced the same result. You want to pad with spaces and I think the only way you can do that in Ninox is with the non-breaking space.

    • Sean
    • 4 yrs ago
    • Reported - view

    I tried this and it worked with a regular space...

     

    createTextFile(this, rpad(myName, 50, " "), "TestPlainSpace.txt")

     

    Try your code with a regular space in the rpad function and see if it works.

    • vacunasrls
    • 4 yrs ago
    • Reported - view

    Thank you! It works but another problem come out. I am not sure yet but it seems that the return ( + " 

    " + ) it is calculated as a space and so it adds me 1 byte to the file. Is there any solution ?   

    • Sean
    • 4 yrs ago
    • Reported - view

    Don't use return. :)

    If you create a text file with a text editor you will get the same result.

Content aside

  • 4 yrs agoLast active
  • 6Replies
  • 1269Views