Add columns to an existing excel sheet


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Add columns to an existing excel sheet
# 1  
Old 07-06-2011
Add columns to an existing excel sheet

Hi All,

i have an excel sheet as below:

day
-----
monday
tuesday
wenesday
thursday
friday

i need to append the two more columns in this existing file below:

insert date should be todays date---

day insert date insert user
---- ---------- -----------

monday sysdate arun
tuesday sysdate arun
wenesday sysdate arun
thursday sysdate arun
friday sysdate arun

please advise..

thanks in advance..
Arun Manas
# 2  
Old 07-06-2011
Code:
$ sed 's/.*/& sysdate arun/' test.txt
monday sysdate arun
tuesday sysdate arun
wenesday sysdate arun
thursday sysdate arun
friday sysdate arun

---------- Post updated at 09:28 PM ---------- Previous update was at 09:28 PM ----------

Code:
$ awk '{printf("%s sysdate arun\n",$0)}' test.txt
monday sysdate arun
tuesday sysdate arun
wenesday sysdate arun
thursday sysdate arun
friday sysdate arun

---------- Post updated at 09:29 PM ---------- Previous update was at 09:28 PM ----------

Code:
$ sed 's/$/ sysdate arun/' test.txt
monday sysdate arun
tuesday sysdate arun
wenesday sysdate arun
thursday sysdate arun
friday sysdate arun

---------- Post updated at 09:30 PM ---------- Previous update was at 09:29 PM ----------

Code:
$ while read line; do echo  "$line sysdate arun"; done < test.txt
monday sysdate arun
tuesday sysdate arun
wenesday sysdate arun
thursday sysdate arun
friday sysdate arun

# 3  
Old 07-06-2011
Hi Kamraj,

Thanks for the reply..

in place of the sysdate, i need to display the current date...

Thanks in advance,
Arun Manas
# 4  
Old 07-06-2011
Code:
$ awk -v sysdate="`date`" '{printf("%s %s arun\n",$0,sysdate)}' test.txt
monday Thu Jul  7 00:37:43 SGT 2011 arun
tuesday Thu Jul  7 00:37:43 SGT 2011 arun
wednesday Thu Jul  7 00:37:43 SGT 2011 arun

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add new columns based on existing columns

Hi all, I am kind of stuck with printing my desired output. Please help me if you know how it can work. My input file(tab separated): NW_0068.1 41,16 100,900 NW_0699.1 4,2,19 200,700,80 My Output file (desired): NW_0068.1 41,16 100,900 100 - 141 NW_0068.1 41,16 100,900 ... (3 Replies)
Discussion started by: sam_2921
3 Replies

2. 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

3. Windows & DOS: Issues & Discussions

Comparing two columns in same Excel sheet

Hi, I have a great doubt in Lotus Symphony Spread Sheet (Hope its similar to Excel) Am new to this Lotus Symphony Please tell me a formula to compare two columns in Excel (Lotus Symphony Spread Sheet) The columns contain strings. Eg., "Column E" and "Column AO" needs to be compared Like... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

4. Shell Programming and Scripting

Format Excel sheet

Hi, I want to format Excel sheet through Unix script. Format would mean bolding the data in the cell, adding clor to it etc. Please help me if it is possible through Unix scripting? Thanks, Durga (2 Replies)
Discussion started by: Durga Prasad NK
2 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. Shell Programming and Scripting

Pdf to excel sheet??

Hi everyone, I want a shellscript code that takes an pdf as input and returns the data in the pdf into an excel sheet... Thanks, C10 (3 Replies)
Discussion started by: Carlton
3 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

How to update existing excel sheet using shell script

Hi All, I am having an excel sheet with pre-defined format which our business team specified, what i need to do is i have to write a script which need to pick values from database and update specified cells in excel sheet.. can any one please help me in this regard.. I am able to pull the... (3 Replies)
Discussion started by: balanarendra
3 Replies

9. Shell Programming and Scripting

writeExcelXML will work on existing excel sheet

I want to know that will SpreadSheet::WriteExcelXML will work on the existing excel file. (1 Reply)
Discussion started by: akash
1 Replies

10. HP-UX

Creating Excel Sheet in Hp-UX

Dear Members, How do I create an eqvivalant of Excel sheet in Hp-UX. Is there any application like the Microsoft Excel on HP-UX. How do I invoke it. Regards, PrasadKVS (5 Replies)
Discussion started by: KVSPRASAD
5 Replies
Login or Register to Ask a Question