Script to generate Excel file or to SQL output data to Excel format/tabular format
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
Here is the data, which should start from the second row and fill the data for each employee in a associated row but here also data is coming in a separate row, like have n number of rows.
Expected foramat of data is tabular/excel format with Fixed header.
can anyone help me to generate the excel file by script.
---------- Post updated at 03:08 PM ---------- Previous update was at 12:42 PM ----------
Below is the script which is actually contain nothing only the query.
Operating system :SUNOS/Solaris
Database : oracle
Current script giving me the correct but inform of data , not inform of record/table/excel.
Hi,
I have generated a report that contains many columns and since I need ir in excel format.. I just renamed te file to excel as follows:
cp vijay.txt vijay.xls
I have just attached this spreadsheet in the mail and I am getting it to my mail id. But, in the output excel, the columns that... (10 Replies)
I can convert a excel file to another format , for example text type ( TXT) whit anoter caracter from delimiter a rows ???
I can change the default delimiter " | " ( or space ) of cell to another caracter ( for example @@ or ## ) without change the other space ??? (6 Replies)
I have some files created in Excel that have to be saved as .txt files in order to load them into our accounting system. I can save the files as .txt files through Excel, but I then have to open them in TextPad and do a save as to change the Format from PC to UNIX. Is there a way to skip this step... (2 Replies)
Hi All,
I have created a Unix Shell script whch creates a *.csv file and export it to Excel.
The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example :
if the Amount has the value as 3000000 User wants to be in 3,000,000 format.
This Amount format... (2 Replies)
I need your help in changing the script
I have data has below text file
:> cat my_emp
Employee array(0)
Name : Albert
No : 1234
Address: stationstraat
City: Utrecht
Employee array (1)
Name : Kouwen
No : 1256
Address: stationstraat
City: Amsterdam
Employee array (2)
Name : Peter... (2 Replies)
i need to write script to copy the txt file to excel. (data can be 2000+), data may not be in order
ex:
my name: abc
age: 20
add: xyz
DOB: 17-mar-2010
add1: adf
add2: guioth
my name: cat
age: 35
DOB: 11-oct-2005
city: yeshjl
add: opq
DOB: 17-mar-2010
add1: atg
add2: gth
add3:ert
... (2 Replies)
Hi Guys..
Need your help to format the output of my shell script.
I am using spool command to take out put in csv file.
below is my code. (for example)
col USERNAME for a15
col EMAIL for a30
col FULL_NAME for a20
col LAST_LOGIN for a40
col DATE_CREATED for a40
SPOOL 120.csv... (3 Replies)
hi,
i have a text file that looks like this!
i want to generate an excel sheet out of it, removing all the junk data except the addresses
that look like
. Arrow Electrical Services
Rotating Machinery, Electrical Contracting & Mining Specialists
Onsite maintenance, breakdown... (8 Replies)
Hi I am working on a script in which I am firing a query on database through Unix and getting the result set. I want to export that in an excel file. I am able to do so nut the result are exported horizontally one below the other. Can anyone plss help me out in exporting the Result in Tabular... (4 Replies)
Discussion started by: Saritau3
4 Replies
LEARN ABOUT PHP
msql_fetch_row
MSQL_FETCH_ROW(3)MSQL_FETCH_ROW(3)msql_fetch_row - Get row as enumerated arraySYNOPSIS
array msql_fetch_row (resource $result)
DESCRIPTION msql_fetch_row(3) fetches one row of data from the result associated with the specified query identifier. The row is returned as an array.
Each result column is stored in an array offset, starting at offset 0.
Subsequent call to msql_fetch_row(3) would return the next row in the result set, or FALSE if there are no more rows.
PARAMETERS
o $
result -The result resource that is being evaluated. This result comes from a call to msql_query(3).
RETURN VALUES
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.
EXAMPLES
Example #1
msql_fetch_row(3) example
<?php
$con = msql_connect();
if (!$con) {
die('Server connection problem: ' . msql_error());
}
if (!msql_select_db('test', $con)) {
die('Database connection problem: ' . msql_error());
}
$result = msql_query('SELECT id, name FROM people', $con);
if (!$result) {
die('Query execution problem: ' . msql_error());
}
while ($row = msql_fetch_row($result)) {
echo $row[0] . ': ' . $row[1] . "
";
}
msql_free_result($result);
?>
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.0.4 | |
| | |
| | A bug was fixed when retrieving data from col- |
| | umns containing NULL values. Such columns were |
| | not placed into the resulting array. |
| | |
+--------+---------------------------------------------------+
SEE ALSO msql_fetch_array(3), msql_fetch_object(3), msql_data_seek(3), msql_result(3).
PHP Documentation Group MSQL_FETCH_ROW(3)