1. Peter Klopfer
  2. PowerBuilder
  3. Monday, 20 July 2020 13:20 PM UTC

Hi,

we are saving the contents of a multi-column grid datawindow using saveAsFormattedText:

dw.saveAsFormattedText (

   ls_file

   , EncodingANSI!

   , "~t" /*sep*/

   , ''" /*quote*/

   , "~r~n" /*lineending*/

   , false /*retainnewlinechar*/

)

There will always be an additional empty column, i.e. each line will end by "~t~r~n".

This is no big issue with text files or export to excel, but with some more specific applications such as R.

Besides, this problem has been bothering us for many years and several different PB versions.

Any hints?

 

Regards,

Peter

 

 

Peter Klopfer Accepted Answer Pending Moderation
  1. Monday, 20 July 2020 20:17 PM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,
thank you for your answer.

As a workaround, something like a FileReadEx(), then a ReplaceAll ( "~t~r~n", "~r~n" ) , followed by a FileWriteEx() should fix that.

This is exactly what we did, but with datawindows of considerable size it will cost too much time. Some of our clients generate datasets of several million rows.

So we will follow your advice and open a support ticket.

Regards, Peter

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 20 July 2020 16:23 PM UTC
  2. PowerBuilder
  3. # 2

Hi Peter;

  This sounds like a legacy bug. Please open a Support Ticket for this issue.

   As a workaround, something like a FileReadEx(), then a ReplaceAll ( "~t~r~n", "~r~n" ) , followed by a FileWriteEx() should fix that.

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.