Need to append columns for every run


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to append columns for every run
# 15  
Old 02-08-2011
Yes.. If I have a header in that as jobname and then processdate(which are big) . So by using the tab, the actual data is not coming under these headers.

jobname 20110108
xyz 25
abc 24
dfg 26

here jobname and 20110108 are the headers.
# 16  
Old 02-08-2011
That's just a formatting issue use expand to expand the tabs to any width you like, before printing or output to terminal. But keep them as tabs in the file as it's easier to process that way (eg using cut or exporting to excell or whatever else).

eg for 10 space tabs:

Code:
$ expand -t 10 runtimes
Process   201100209
xyz       137
abc       84
sdf       50
lkj       145

This User Gave Thanks to Chubler_XL For This Post:
# 17  
Old 02-09-2011
Thanks a lot Chubler XL.
# 18  
Old 02-23-2011
Hi,
I am saving this data in excel sheet, and when I delete a column from excel and then uploading it to unix box, the paste is not working properly.
Code that im using:
Code:
paste output.xls todaysrun.xls > output1.xls
mv output1.xls output.xls

Previously the data was like this:
Code:
Jobnames2011021820110218pdw_rig30d_cmd275275pdw_brkgactdim01d_cmd216216pdw_spvn_case01d_cmd130130pdw_cmatrnunl10d_cmd9696pdw_repref10d_cmd00pdw_seccurrdim01d_cmd9797pdw_trucnv10d_cmd9191pdw_rck01d_cmd9999pdw_wkbmindxclient01d_cmd6767pdw_clpracctbchmk01d_cmd8787

Output after deleting a column from output.xls and rerunning the job:
Code:
Jobnames2011021820110217pdw_rig30d_cmd275336pdw_brkgactdim01d_cmd216190pdw_spvn_case01d_cmd130131

Instead of coming side by side, it is coming in the same line. Can someone pls help me with this.

Thanks
Ajay

---------- Post updated at 11:12 PM ---------- Previous update was at 11:04 PM ----------

Sorry the format was not good in my previous post:
Before output:
Jobnames 20110218 20110218
pdw_rig30d_cmd 275 275
pdw_abc_cmd 136 136

Later I deleted the duplicate 20110218 column and uploaded it to unix box and ran the script again, it is giving me the following output:
Jobnames 20110218
20110217
pdw_rig30d_cmd 275
260
pdw_abc_cmd 136
130
# 19  
Old 02-23-2011
When you save your document from Excel what format are you saving in?

If your not already doing so, use "File->Save As" and in the "Save as Type" drop-down select "Text (Tab delimited) (*.txt)"

Last edited by Chubler_XL; 02-23-2011 at 01:40 AM..
# 20  
Old 02-23-2011
But I need the format to be in xls as I need to do some analysis on that excel. Is it not possible to keep the format as excel and delete the column?

---------- Post updated 02-23-11 at 12:22 AM ---------- Previous update was 02-22-11 at 11:27 PM ----------

Ok. I got it.. Thank you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Python script to run multiple command and append data in output csv file

Experts, I am writing a script and able to write only small piece of code and not able to collect logic to complete this task. In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file Now have to... (0 Replies)
Discussion started by: as7951
0 Replies

2. Shell Programming and Scripting

awk dynamically append columns into file

Hi, I have a large data file, want to separate it into 100 part and export one specific field as a file; then I want to append each part's column into one file. How to realize that? 1 2 3 1 2 3 4 2 2 3 4 3 3 3 4 4 3 4 5 5 3 4 5 6 I want the last column of the data file, e.g divide it... (5 Replies)
Discussion started by: wanliushao
5 Replies

3. Shell Programming and Scripting

First run overwrite then append

I'm overwriting .unl in first run and after that in seq. runs appending by following method. Any other method or command can do it easier? ARY_VALUE=1 while do if ; then type.sql > out.unl else type.sql >>out.unl fi ARY_VALUE--; done (3 Replies)
Discussion started by: Roozo
3 Replies

4. UNIX for Dummies Questions & Answers

append a column by concatenating other columns

Hi In a tab delimited file how can I add a column that have values concatenated from all columns. For example input.txt test1 test2 test3 zz2 mm uu pp3 yy kk ss2 tt ll zz3 mm uu pp23 yy kk ss3 tt ll 11e 22 44 33c 22 99 output.txt test1 test2 test3 reslt (6 Replies)
Discussion started by: mary271
6 Replies

5. Shell Programming and Scripting

To append two columns without double quotes

Hi i have a file with follw data "20090427","0","","16371311","-100200","","","","16371311","JUL","09" In the 10th column i need to convert the month name into month number in this case JUL will be 7 and append the 10th and 11th column which shows me the output as 709. Can you suggest a shell... (11 Replies)
Discussion started by: vee789
11 Replies

6. Shell Programming and Scripting

question about append columns

I like to do the following, please help! Thanks a lot for f in seq(f1 f2 f3 g1 h1 t2) do cut -d "+" -f2 $f > $f.nums paste ? # each loop will attach additional column to the created file $f.nums, how to do this??? done (1 Reply)
Discussion started by: ksgreen
1 Replies

7. Shell Programming and Scripting

append an output file with two columns

Hi All, can you help me with this: grep XXX dir/*.txt|wc -l > newfile.txt - this put the results in the newfile.txt, but I want to add another column in the newfile.txt, string 'YYYYY', separated somehow, which corresponds on the grep results? For example grep will grep XXX dir/*.txt|wc -l >... (5 Replies)
Discussion started by: apenkov
5 Replies

8. Programming

Compare two files of 4 columns and o/p unique,append zero's

I have to files File1 1 23 2 34 3 7 4 56 5 61 6 22 7 65 File2 2 21 4 32 7 22 Now i need to compare column1 of both the files and generate a third file which should contain all the values of 1st column of 1st file and in the second column i need to get the coressponding row... (2 Replies)
Discussion started by: kamuju
2 Replies

9. UNIX for Dummies Questions & Answers

append files as columns

Hi, I will rephrase my question. I have two files: q16 1.341E+05 wf8 3.084E+02 total1 1.344E+05 ud35 5.694E+03 us38 9.367E+05 ya23r 9.414E+02 up23s 2.403E+04 io240 1.203E+04 q16 1.341E+05 wf8 3.084E+02 total1 1.344E+05 ud35 5.694E+03 us38 9.367E+05 (2 Replies)
Discussion started by: f_o_555
2 Replies

10. Shell Programming and Scripting

Append string to columns from 2 files

Hi Having a file as follows file1.txt Date (dd/mm)Time Server IP Error Code =========================================================================== 10/04/2008 10:10 ServerA xxx.xxx.xxx.xxx 6 10/04/2008 10:10 ServerB ... (3 Replies)
Discussion started by: karthikn7974
3 Replies
Login or Register to Ask a Question