Hello Folks,
I want to get the results from a SQL query which needs to be exported to a .txt file.
My Script is something like
#!/bin/ksh
db2 connect to DATABASE user user_name using pwd;
touch test.txt
isResult=0;
isResult= `db2 -x select 'ABC',COL_B from TABLE_A WHERE COL_B=CONDITION`
print "$isResult" >> test.txt
echo Done
So in the test.txt I am getting the output as
ABC_COLBDATA
ABC_COLBDATA
ABC_COLBDATA
ABC_COLBDATA
WhiteSpace is marked as _
My question is that How can I remove the space between each column. While writing on to the output file,Space is automically getting populated between each column. Please help me on this. Thanks in advance!!
---------- Post updated at 04:24 AM ---------- Previous update was at 04:08 AM ----------
The issue of single space between each column is resolved.
But there is one more catch here. There is column value which contains eight blank spaces which needs to be printed.