remove newline character from field in exported table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ofilha
    New Member
    • Jul 2007
    • 11

    remove newline character from field in exported table

    I am trying to export the resultset of a query to a character delimited file. I am using the wizard for this. However, one of the fields is 512 characters long and it accepts from form address. It looks like the field contains newlines, but when i look at the resultset in DB2 i don't see any newline characters, only after i copy it and then paste it to notepad or textpad. When i export the table, this field contains several newline characters.
    I am trying to resolve this. I have used tr in unix and it removed some of the newline characters but it does not seem to work. Does anyone have any ideas as how i can remove newlines from the export file?
    Thanks.
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    I have two questions. First, what is the "new line character"? Is it an actually character? If so, you could possibly do a "Find and Replace". Second, have you tried exporting the file to wordpad (.rtf)?

    You could import the text file into say MS Access and remove the characters from there and re-export it back to a text file.


    HTH,
    Bender

    Comment

    • ofilha
      New Member
      • Jul 2007
      • 11

      #3
      yes, it is a newline character. The problem is that if i do a search and replace, i will be replacing the newline at the end of the line for the row that was exported and i don't want that. i just want to remove the newline character inside the string in the column. I am considering just doing a perl script for this.
      Thanks.

      Comment

      • nsarda2
        New Member
        • May 2009
        • 3

        #4
        Hi

        I used following method

        1) export the data in a delimited file.
        2) Open the deleimited file using edit plus on windows.
        3) the replace the new line character (\n) with nothing

        and then import the data.

        Comment

        Working...