If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Extra Newlines In Piped Output

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-04, 09:18
atmosphere atmosphere is offline
Registered User
 
Join Date: Aug 2004
Posts: 19
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
Reply With Quote
  #2 (permalink)  
Old 09-08-04, 09:52
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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
Reply With Quote
  #3 (permalink)  
Old 09-08-04, 10:45
atmosphere atmosphere is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 09-08-04, 12:31
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On