I am running an ISQL command on Sybase DB and getting output of a query in an CSV file.
The issue is that all the data comes in to the same column, i want them to be separated in different columns.
SQL_COMMAND=command.sql
file=file.txt
formatFile=formatFile.txt
report=report.csv
echo "SELECT 'DATA',usr_nme,' ',office' ',frst_nme,' ',last_nme
FROM abcTable" > $SQL_COMMAND
isql -U ${USER} -S ${SERVER} -P ${PW} -i${SQL_COMMAND} -w300 -o ${file}
grep DATA $file >> $formatFile
sed s/DATA// $formatFile >> $report
All the four columns data, i.e user name, office first name and last name comes in single column of csv file. Please suggest how can i separate it.
Sample of output:
sharma331 0116 Alisa kri
Above data comes in single column