Help in formatting text extracted from DB

Hi,

I have extracted some data from DB and it has three columns. When i open the file in excel it all comes just only in one column. I want all the 3 columns to come in A, B, C columns. Could some one please help me with that on how to do the same ?

Regards,

RR

Try separating the columns with tabs.

hmm..at this point it does'n seem to be unix related question :rolleyes: However, are you extracting a delimited file ? Guess you do not have delimiters hence all comes in one column. For further understanding let us know how do you 'extract' data from the DB

See if you can make use of excel "text to column" from data menu.

1 Like

Hi,

Thanks for all your replies.

I actually run the sql statement inside the script and it fetches three columns from DB. And it comes likes this.

AAAA BBBBBBB [BBB] CCCCC
AAAA BBBBBBBBB [BBBB] CCCC

I am also inserting the heading for this three coulmns through an echo command. But when i open the csv file all are under column A.

@YGOR - How can I tab the columns that is being taken from the DB through an SQL command.
@ michaelrozar17 - I just ask this because I am calling the SQL only from a shell script and just want to know is there a way to format these text with the headings to appear in a proper way?

@xoops - I can check that, but I am sending the file directly from my script in the email. So i doubt that will work.

Let me know if this can be achieved by sed or awk?

Regards,

RR

---------- Post updated at 10:26 AM ---------- Previous update was at 08:42 AM ----------

Guys,

Nevermid. I figured it out and it works fine now. Thanks all for your help.