Export into a single cell of excel sheet...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Export into a single cell of excel sheet...
# 1  
Old 04-17-2009
Export into a single cell of excel sheet...

The awk is giving below output:

SELECT
divrel.child_org_idn org_main_idn
NULL ( VARCHAR(200)) div_nam_2
NULL ( VARCHAR(200)) div_nam_3
NULL ( VARCHAR(200)) div_nam_4
NULL ( VARCHAR(200)) div_nam_5
NULL ( VARCHAR(200)) div_nam_6
NULL ( VARCHAR(200)) div_nam_7
1(DECIMAL(120)) LEVEL
FROM $FDS_REP.org_main_rel_a divrel
JOIN $FDS_REP.org_main_d childdiv
ON childdiv.org_main_idn = divrel.child_org_idn
WHERE divrel.parnt_org_idn = -99999
AND childdiv.src_idn = 116
AND divrel.rel_desc = 'DIVISION HIERARCHY'
UNION ALL
SELECT
divrel.child_org_idn
CASE WHEN LEVEL+1 = 2 THEN childdiv.org_nam ELSE divrec.div_nam_2 END div_nam_2
CASE WHEN LEVEL+1 = 3 THEN childdiv.org_nam ELSE divrec.div_nam_3 END div_nam_3
CASE WHEN LEVEL+1 = 4 THEN childdiv.org_nam ELSE divrec.div_nam_4 END div_nam_4
CASE WHEN LEVEL+1 = 5 THEN childdiv.org_nam ELSE divrec.div_nam_5 END div_nam_5
CASE WHEN LEVEL+1 = 6 THEN childdiv.org_nam ELSE divrec.div_nam_6 END div_nam_6
CASE WHEN LEVEL+1 = 7 THEN childdiv.org_nam ELSE divrec.div_nam_7 END div_nam_7
divrec.LEVEL+1
FROM $FDS_REP.org_main_rel_a divrel
JOIN $FDS_REP.org_main_d childdiv
ON childdiv.org_main_idn = divrel.child_org_idn
JOIN divrec
ON divrel.parnt_org_idn = divrec.org_main_idn
WHERE
childdiv.src_idn = 116
AND divrel.rel_desc = 'DIVISION HIERARCHY'
)
SELECT *
FROM divrec,

My requirement is this entire query should go into a single cell of the excel sheet but its going as different rows of eexcel as the new line is taken as new row. Please suggest...Smilie
# 2  
Old 04-17-2009
Place the text within double quotes and save it as a csv file.

Regards
# 3  
Old 04-17-2009
tnx a ton... its works great
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse excel file with html on each cell

<DIV><P>Pré-condição aceder ao ecrã Home do MRS.</P></DIV><DIV><P>OK.</P></DIV><DIV><P>Seleccionar Pesquisa de Recepção Directa.</P></DIV><DIV><P>Confirmar que abriu ecrã de Recepção Directa.</P></DIV><DIV> (6 Replies)
Discussion started by: oliveiraum
6 Replies

2. UNIX for Advanced & Expert Users

awk - If then else rule like Excel cell

Hi, I need extract / transpose where "Y" in the input file My input file is Item,EB,SB,SD,TP,GR LP,Y,N,N,N,Y GC,Y,N,N,N,N CO,N,Y,Y,Y,Y PS,Y,N,N,Y,Y Expecting output is EB-/'LP/',/'GC/',/'PS/' SB-/'CO/' SD-/'CO/' TP-/'CO/',/'PS/' GR-LP,CO,PS I appreciate for your help Regards (4 Replies)
Discussion started by: myrole
4 Replies

3. Shell Programming and Scripting

Summing up the data from different excel sheet into one excel sheet

Hi Folks, Can you please advise for any script in unix such that for example , i have 3 different excel sheet at the location /ppt/gfr/exc so the name s of the excel sheet are 1excel.xslx 2excel.xslx 3excel.xslx now in these 3 different excel sheet there is lot of data for example each... (3 Replies)
Discussion started by: punpun66
3 Replies

4. Shell Programming and Scripting

Export data from database in Excel sheet with the help of Shell script and automated the report

Export data from database in Excel sheet with the help of Shell script and automated the report every day in the mornig. (1 Reply)
Discussion started by: neeraj617
1 Replies

5. Shell Programming and Scripting

Perl : to get all the hyperlinks from the xlsx sheet(hyperlinks not visible in excel sheet directly)

Hi folks, I have a requirement in perl to print all the hyperlink from the spreadsheet(xlsx). Spreadsheet contains few lines of hyperlink data (pic attached). P.S. Hyperlink is behind the data and not visible in excel sheet directly. Now using perl script I need to copy the hyperlinks in... (3 Replies)
Discussion started by: scriptscript
3 Replies

6. UNIX for Dummies Questions & Answers

how to fill the name of the spread sheet as a cell's data

In open office spreadsheet, i would like to fill a cell with the name of the spread sheet. That is if the file name of spread sheet is, team.ods, then i have to fill a specific cell with that name 'team'. How to do that ? I have more spread sheets to be created, so i want it to be done... (0 Replies)
Discussion started by: thegeek
0 Replies

7. Solaris

Excel sheet

Hello, I have an information of about 100 odd file names which i have in my server. I need to attach this information in an excel sheet and sent to the concerned team. I use uuencode for attaching a text file. But how will i have all the information in attachment. Please assist. Is there... (1 Reply)
Discussion started by: venkidhadha
1 Replies

8. Shell Programming and Scripting

PERL: Modify Excel cell formatting

Hi, I would like to modify an existing excel cell format to a custom format. Is there a way to do it with out writing into a new excel file. In-place editing? Thanks (0 Replies)
Discussion started by: sandeep78
0 Replies

9. Shell Programming and Scripting

How to change cell background in excel sheet using perl

I need to change a cell in an excel sheet to different background color using perl.I tried SaveParse, but was unable to get it Please help regarding this. Thanks and Regards, Neelam G https://www.unix.com/images/misc/progress.gif (0 Replies)
Discussion started by: gujrathinr
0 Replies

10. UNIX for Dummies Questions & Answers

Change the cell background in excel sheet using Perl

I need to change a cell in an excel sheet to different background color using perl. Please help regarding this. Thanks and Regards, Neelam G (1 Reply)
Discussion started by: gujrathinr
1 Replies
Login or Register to Ask a Question