Export to a TXT file

Export to a TXT file

  
Hello people!

In plataform is possible export one table for TXT file??

Regards, Paulo Torres
Hi,

There are already functionalities to export entities to Excel.
To export to txt you need to build the file format for example:
For each record in table generate line with this format on text variable
<Value 1>|<Value 2>|<Value 3>.....|<Value n>
Then using the extension binary data, use the function TextToBinaryData and then you can download the file, using the download object in the Service Studio.

Regards,

Nelson Inácio
Thanks Nelson.

Is possible to export directly to TXT with the values ??separated by commas?

Regards, Paulo Torres
Hello Paulo,

there are some ways to do it, but not directly and out of the box... at least i think not.

but take a look on this, probably it does what you want, im not sure since i never used it.

let us know more about it.

HTH, regards,
Miguel Antunes

Thanks Miguel.
I understand that it is not simple...

Regards, Paulo Torres

Hi Paulo,

Actually, the extension that Miguel showed you makes it really simple. You just have to install it in your server, and call an action. It will convert the Record List to a CSV file - which is, in reality, a text file with comma as a separator.

After that, you just have to have an action with a Download node, with the result of the RecordListToCSV action.

Wasn't that what you were looking for? Have you tried it out?

Regards,

Paulo Tavares
is there any direct way to export the table to notepad already separated by commas?

Regards, Paulo Torres
This isn't hard, just have a Text variable... do you query, For/Each through the results, add to the Text variable as needed. You can then write to a file on disk using the FileSystem extension to put the data into the text file. If you then want to send that file to the user, use the DownloadFile widget, and pass to it the results of calling TextToBinaryData (in the BinaryData extension) on the Text variable.
J.Ja
Thanks =)
Do you have any example (E-space or Print Screen)?

Regards, Paulo Torres
Answer to:
"Thanks Nelson.

Is possible to export directly to TXT with the values ??separated by commas?

Regards, Paulo Torres"

Yes, it's possible to build a file separated by commas, you can decide the file format, since there are no direct conversion to a text file, you need to build yourself the file format and the functions to write the file, then use the binarydata extension to convert the text to binary data and then use the download widget to get the file. 
To read the file the extension CSV has functions to transform the data into a record list.

Regards,

Nelson Inácio
I don't have any samples offhand, but it should only take you a few minutes to work through it once you get those extensions. I've found that those extensions (BinaryData and FileSystem) are two very important extensions to get familiar with, along with HTTPRequestHandling.

J.Ja