insert header row into .xls


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers insert header row into .xls
# 8  
Old 12-06-2007
Is the only way to put in a header row to actually create another file to concatenate it with?
# 9  
Old 12-06-2007
Create a file with

Code:
USERNAME	ACCT_STATUS	LOCK_DT	EXPIRY_DT	CREATED	PROFILE	SIDBA	EXPCTD_PROFILE	REMARKS

in it called "header-row".

Code:
mv QrtlyDBUsers.xls data-rows
cat header-row data-rows >QrtlyDBUsers.xls

of course file names are just suggestions.

or

Code:
mv QrtlyDBUsers.xls data-rows
cat - data-rows >QrtlyDBUsers.xls <<EOF
USERNAME	ACCT_STATUS	LOCK_DT	EXPIRY_DT	CREATED	PROFILE	SIDBA	EXPCTD_PROFILE	REMARKS
EOF

# 10  
Old 12-06-2007
Hey Porter,

Hmm well I think I have confused the group. The column names (username, etc) are good and they are appearing at the top of the column and data is lining up etc..
what I was hoping to do is add the line of 'Audit Report: 12/07/2007' before the start of the column names Username, Acct_status, etc..

Audit Report: 12/07/2007
USERNAME ACCT_STATUS LOCK_DT EXPIRY_DT CREATED PROFILE SIDBA REMARKS


Thanks for your time.
# 11  
Old 12-06-2007
I would do it the same way

Code:
echo "This is my report generated on"  `date` | cat - data-rows >finals.xls

# 12  
Old 12-07-2007
Thanks for your help Porter!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert header with underline?

How to insert header with underline AM able to insert only header not underline sed '1i NAME COUNTRY' test.txt input file UK 1234 USA 2354 AUS 2253 IND 4256 Output file NAME COUNTRY_CODE ---- ------------ UK 1234 USA 2354 AUS 2253 IND 4256 (5 Replies)
Discussion started by: Kalia
5 Replies

2. Shell Programming and Scripting

At text to field 1 of header row using awk

I am just trying to insert the word "Index" using awk. The below is close but seems to add the word at the end and I can not get the syntax correct to add from the beginning. Thank you :). awk -F'\t' -v OFS='\t' '{ $-1=$-1 OFS "Index"}$1=$1' file current output Chr Start End ... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Shell Programming and Scripting

How to display the header of a matched row in a file?

Hi, So I am trying to print the first row(header) first column alongwith the matched value. But I am not sure how do I print the same, by matching a pattern located in the file eg File contents Name Place Jim NY Jill NJ Cathy CA Sam TX Daniel FL And what I want is... (2 Replies)
Discussion started by: sidnow
2 Replies

4. Shell Programming and Scripting

Add column header and row header

Hi, I have an input like this 1 2 3 4 2 3 4 5 4 5 6 7 I would like to count the no. of columns and print a header with a prefix "Col". I would also like to count the no. of rows and print as first column with each line number with a prefix "Row" So, my output would be ... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

5. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

6. Shell Programming and Scripting

Perl array with row header

Here is the csv file file i have: ServerName, IPAddress, Gateway, Notes ServerA, 192.168.1.100, 192.168.1.1, This is some server ServerB, 192.168.1.110, 192.168.1.1, This is some other server ServerC, 192.168.1.120, 192.168.1.1, This is some other other server I would like to have the... (6 Replies)
Discussion started by: Ikon
6 Replies

7. UNIX for Dummies Questions & Answers

split header row into one column

So, I have a massive file with thousands of columns I want a list of the headers in one column in another file. So I need to strip off the top line (can use head-1) But how can I convert from this format: A B C D E F G to A B C D E F G (6 Replies)
Discussion started by: polly_falconer
6 Replies

8. Shell Programming and Scripting

Insert Header Name

Can anyone help. I have sql to CSV showing header with ALIAS names but I want to generate CSV file with user friendly name i.e from AIAN8 to Adress Book Number etc. SELECT AIAN8 || , || F0101.ABALPH || , || AICO || showing following below in CSV output intead of above Address... (4 Replies)
Discussion started by: s1a2m3
4 Replies

9. Shell Programming and Scripting

How to insert data befor some field in a row of data depending up on values in row

Hi I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example. The original data record should be some thing like this 60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

10. Shell Programming and Scripting

unable Insert data from .dat file to .xls can anybody help me

Hi All, I am new to unix Shell scripting Actually i need to write a shell script to insert data from a dat file to ms-Excel file The data in the dat file will be like this Col1 Col2 Col3 Col4 and and Col5 I a new... (1 Reply)
Discussion started by: kreddy2003
1 Replies
Login or Register to Ask a Question