Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    19

    Unanswered: Extra Newlines In Piped Output

    Hey

    I have a simple command line statement

    db2 -x SELECT item FROM table a > file.out

    item in this case is a varchar of length exactly 698. For some reason in my output im geting additional newline characters. IE, each row is seperated by a blank line.

    I have tried the -n flag which supposedly suppresses newline characters (but i think this means ones that are actually located in the data)

    Please help. Im really stuck here and I need this data without the spaces

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Try ,
    db2 -x select left(item,20) from table a

    If this does not produce blank llines, then the blank lines could be because of the length of data ..

    Cheers
    Sathyaram

  3. #3
    Join Date
    Aug 2004
    Posts
    19
    thanks for the quick reply

    although, no luck this does not help the situation. I just dont see why the length of teh output would produce an additional newline character.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    what editor are you using to look at the file ... Probably the editor is wrapping the lines and your actual content of the column contents is less than 628 ... So, it appears you have multiple lines ...

    HTH

    sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •