09-04-2002
Formatting excel file
Hi,
I have a problem in formatting the excel file from my script.
Assume that there is a text file generated using a 'C shell Unix script' with a format similar to the one seen below. Each column has a fixed length and every row is going to have a value against a column depending on the section in picture. It could be simply empty space as well. What I am trying to say is that the rows under each section are going to be of fixed length with clear separation between each column.
Annual Report
--------------
First Section
-------------
ABC DEF HGFDG JKLLJ
--- --- ----- -----
111 343 hhhjh 67676
989 242 sdsff 56547
Second Section
--------------
QER BNM TRERT DFDGF
--- --- ----- -----
111 343 hhhjh 67676
989 242 sdsff 56547
Summary
-------
First Section - 2 lines Second Section - 2 lines
Requirement:-
It is required to view the text file contents in an excel sheet. It goes without saying that the contents should be appropriately formatted. In other words say the first line here 'Annual Report' needs to be centered to the contents beneath it. Similarly in each section the column names need to appear in individual cells.
Trial made:-
An attempt was made to save the text file as a '.xls' file in the script itself. On opening the file it was found that the headers both the overall heading and the section headers were not properly aligned. Also the column names did not appear in separate cells though the column data appeared in individual cells possibly because each row under a section is of fixed length as described above.
Question:-
Is it possible to write a 'MACRO' using Unix or any other language so that it is possible to view the text file content in an excel sheet with necessary formatting applied? Suggest any possible method known.
with thanks in advance
subra
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to find a way to read an excel work book with multiple worksheets.
And write each worksheet into a new excel file using perl. My environment is Unix.
For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create... (2 Replies)
Discussion started by: sandeep78
2 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
Dear folks,
Need a help in Excel processing, I have a sheet which need to be changed to a format as below:
Name Eng Hin SS
A 100 90 83
B 76 99 90
C 55 34 78
Want the above sheet to below format
Name Sub Marks
A Eng 100
... (5 Replies)
Discussion started by: shaliniyadav
5 Replies
4. Shell Programming and Scripting
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)
Discussion started by: Agupte
3 Replies
5. Shell Programming and Scripting
I am facing a problem formatting the output of my shell script in excel.
We are directing the output of the script to an excel sheet and need long integer type data printed in Excel as it is (i.e. not in the default scientific notation).
Also, leading zeroes(if any) in the output are getting... (4 Replies)
Discussion started by: bornali.p
4 Replies
6. Shell Programming and Scripting
I am trying to create a program where user can input data in certain excel cells using user interface on internet....the programming is on perl and server is unix
But when i parse data into excel the formatting of sheets is turned to default and all macro coding removed.
What to do...Please... (7 Replies)
Discussion started by: mud_born
7 Replies
7. Shell Programming and Scripting
All,
I have an excel sheet Excel1.xls that has some entries.
I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls
These may be in different workbooks. They are totally independent made by 2 different users.
I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies
8. Shell Programming and Scripting
Hello friends
I want to convert an csv file on unix (which is generated by a ETL application) to a formatted excel sheet like .I have roughly like 28 columns
1)All numbers need to be stored as numbers with leading zeros-like format as text for this column to preserve leading zeroes e.g... (6 Replies)
Discussion started by: etldev
6 Replies
9. Shell Programming and Scripting
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.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies
10. Shell Programming and Scripting
Hello,
I have a file with the below contents :
Policy Name: Backup_bkp
Policy Type: Catalog_bkp
Active: yes
Effective date: 08/07/2013 02:02:12
Mult. Data Streams: no
Client Encrypt: no
Checkpoint: no
Policy Priority: ... (11 Replies)
Discussion started by: rahul2662
11 Replies
LEARN ABOUT PHP
finfo_file
FINFO_FILE(3) 1 FINFO_FILE(3)
finfo_file - Return information about a file
Procedural style
SYNOPSIS
string finfo_file NULL NULL (resource $finfo, string $file_name, [int $options = FILEINFO_NONE], [resource $context])
DESCRIPTION
Object oriented style string finfo::file NULL NULL (string $file_name, [int $options = FILEINFO_NONE], [resource $context])
This function is used to get information about a file.
PARAMETERS
o $finfo
- Fileinfo resource returned by finfo_open(3).
o $file_name
- Name of a file to be checked.
o $options
- One or disjunction of more Fileinfo constants.
o $context
- For a description of contexts, refer to "Stream Functions".
RETURN VALUES
Returns a textual description of the contents of the $file_name argument, or FALSE if an error occurred.
EXAMPLES
Example #1
A finfo_file(3) example
<?php
$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension
foreach (glob("*") as $filename) {
echo finfo_file($finfo, $filename) . "
";
}
finfo_close($finfo);
?>
The above example will output something similar to:
text/html
image/gif
application/vnd.ms-excel
SEE ALSO
finfo_buffer(3).
PHP Documentation Group FINFO_FILE(3)