how to remove carriage returns from the comment text field while exporting data out of sage?

SUGGESTED

I am using Visual Integrator to export SalesOrderDetail.M4T out of sage in a csv format. The challenge i am facing is SalesORderDetail  table has a column called as "CommentText" which contains a carriage returns in the data. 

I want to either get rid of those carriage returns or replace it with space or something. Any help on this would be really appreciated.

Regards

Chetan

  • 0
    Have you tried to pull with other means such as MS Access?
  • 0
    SUGGESTED
    You can change the CR and LF in the by doing a calculation on the field to remove/replace the unwanted characters. Select the column CommentText and make the Operation Calculated, click on the tools at the end of the calculation column and use the substring method to remove or replace the unwanted characters. The expression I used replaced the CR with and *. SUB(SO_SalesOrderDetail01.CommentText$, $0D0A$, "*")
  • 0 in reply to daburke
    Are they CR/LF characters or are they Hard Returns? Seems like I normally have to do CTRL-ENTER for a hard return in comment fields as an ENTER just advances me to the next field. I'm not sure what the ASCII equivalent of a hard return is, but you might have to substitute that in place of $0D0A$ above.

    Daburkes suggestion is good.
  • 0 in reply to TomTarget

    This seems like good advice, and it does improve my exported data, but apparently I'm still not doing it right.
    Following daburke's instructions I am replacing the CR with an asterisk - but I'm still getting extra lines (although not as many as previously). So apparently there's a character in the Memo Text field that is causing something like a carriage return, but is not that.

    My first bit of confusion stems from not understanding how $0D0A$ is equal to the ASCII value for CR, which on my ASCII table looks like Dec 13, Hx D and Oct 015.

    Tom, you mention LF, which I'm guessing is the Line Feed, or Dec 10, Hx A and Oct 012. Do I wrap the Hx value, in this case "A", with $0 and 0A$? 

  • 0 in reply to rclowe

    $0D0A$ = CR+LF (ascii 13 + ascii 10), not just CR. 

    If you have entries with just CR too, perhaps you can add another SUB wrapper around the first one to replace the $0D$...