Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Rename a header column by adding another column entry to the header column name Post 302545117 by ctsgnb on Saturday 6th of August 2011 01:02:34 PM
Old 08-06-2011
Code:
$ cat tst
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
$ awk -F, '{A[NR]=$0}END{sub("Signal","Signal-" $1,A[1]);for(i=0;++i<=NR;) print A[i] }' tst
GrpID,TargetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk/sed column replace using column header - help

$ cat log.txt Name Age Sex Lcation nfld alias xsd CC 25 M XYZ asx KK Y BB 21 F XAS awe SS N SD 21 M AQW rty SD A How can I replace the column with header "Lcation" with the column with header "alias" and delete the "alias" column? so that the final output will become: Name Age Sex... (10 Replies)
Discussion started by: jkl_jkl
10 Replies

2. Shell Programming and Scripting

getting the column header in the output !

i have a script that access the database and then returns some row. but in the command prompt it it not showing the column header. how to get that ? below the script: ------------------------------------------------------------------------ #!/bin/ksh .... (4 Replies)
Discussion started by: ali560045
4 Replies

3. Shell Programming and Scripting

Column header

Hello all, We are trying to run a script in Oracle DB from AIX. We need to set the Column Header while executing the query to generate the Output. For eg. select city, name from emp; It need to generate report in .csv format as CITY NAME atla tom cincin jack How I... (1 Reply)
Discussion started by: velappangs
1 Replies

4. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

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

6. Shell Programming and Scripting

Reading column header

Hi, I have some 10 tab delimited flat files, for some files the column header starts from 1st row whereas for some other files the column header starts from row or row 3 or row4 and so on.... Is there any way in UNIX so that we can read the column headers dynamically.' I am new to UNIX, so... (12 Replies)
Discussion started by: kedar_laveti
12 Replies

7. Shell Programming and Scripting

Print column header

Hi, Below is the data in a tab limited file Here ACCENT is just a heading and the line starting with Pcode has the column headers, and there is a 2 lines space between the file header and column header. I want to print $2, that is Dealer Name I used the below code nawk... (1 Reply)
Discussion started by: kedar_laveti
1 Replies

8. Shell Programming and Scripting

Add Header to column

hello, can someone helpe me on below issue. i have a list of names and IDs, mick 3424 noah 134 samuel 787 jack 434 i want to add a head for both colum using awk or sed or any tool output NAME ID mick 3424 noah 134 samuel 787 (10 Replies)
Discussion started by: Sara_84
10 Replies

9. UNIX for Dummies Questions & Answers

How can i substitute a header column?

Hi, I have a txt file with multiple columns and i want to substitute the header of the first column. Example: Seq. Name Seq. Length #Hits min. eValue mean Similarity #GOs GOs Enzyme Codes InterProScan comp1000201_c0_seq1 ---NA--- 337 0 0 - comp1000297_c0_seq1 ---NA--- 612 0 0 -... (4 Replies)
Discussion started by: alisrpp
4 Replies

10. Shell Programming and Scripting

Sum of a column as new column based on header in a script

Hello, I am trying to store sum of a column as a new column inside a file but have to find the column names dynamically I/p c1,c2,c3,c4,c5 10,20,30,40,50 20,30,40,50,60 If i want to find sum only column c1, c3 and output it as c6,c7 O/p c1,c2,c3,c4,c5,c6,c7 10,20,30,40,50,30,70... (6 Replies)
Discussion started by: mkathi
6 Replies
tapset::signal(3stap)													     tapset::signal(3stap)

NAME
tapset::signal - systemtap signal tapset DESCRIPTION
This family of probe points is used to probe signal activities. Since there are so many signals sent to processes at any given point, it is advisable to filter the information according to the requirements. For example, filter only for a particular signal (if sig==2) or for a particular process (if pid_name==stap). signal.send Signal being sent to a process See probe::signal.send(3stap) for details. signal.send.return Signal being sent to a process completed (deprecated in SystemTap 2.1) See probe::signal.send.return(3stap) for details. signal.checkperm Check being performed on a sent signal See probe::signal.checkperm(3stap) for details. signal.checkperm.return Check performed on a sent signal completed See probe::signal.checkperm.return(3stap) for details. signal.wakeup Sleeping process being wakened for signal See probe::signal.wakeup(3stap) for details. signal.check_ignored Checking to see signal is ignored See probe::signal.check_ignored(3stap) for details. signal.check_ignored.return Check to see signal is ignored completed See probe::signal.check_ignored.return(3stap) for details. signal.force_segv Forcing send of SIGSEGV See probe::signal.force_segv(3stap) for details. signal.force_segv.return Forcing send of SIGSEGV complete See probe::signal.force_segv.return(3stap) for details. signal.syskill Sending kill signal to a process See probe::signal.syskill(3stap) for details. signal.syskill.return Sending kill signal completed See probe::signal.syskill.return(3stap) for details. signal.sys_tkill Sending a kill signal to a thread See probe::signal.sys_tkill(3stap) for details. signal.systkill.return Sending kill signal to a thread completed See probe::signal.systkill.return(3stap) for details. signal.sys_tgkill Sending kill signal to a thread group See probe::signal.sys_tgkill(3stap) for details. signal.sys_tgkill.return Sending kill signal to a thread group completed See probe::signal.sys_tgkill.return(3stap) for details. signal.send_sig_queue Queuing a signal to a process See probe::signal.send_sig_queue(3stap) for details. signal.send_sig_queue.return Queuing a signal to a process completed See probe::signal.send_sig_queue.return(3stap) for details. signal.pending Examining pending signal See probe::signal.pending(3stap) for details. signal.pending.return Examination of pending signal completed See probe::signal.pending.return(3stap) for details. signal.handle Signal handler being invoked See probe::signal.handle(3stap) for details. signal.handle.return Signal handler invocation completed See probe::signal.handle.return(3stap) for details. signal.do_action Examining or changing a signal action See probe::signal.do_action(3stap) for details. signal.do_action.return Examining or changing a signal action completed See probe::signal.do_action.return(3stap) for details. signal.procmask Examining or changing blocked signals See probe::signal.procmask(3stap) for details. signal.procmask.return Examining or changing blocked signals completed See probe::signal.procmask.return(3stap) for details. signal.flush Flushing all pending signals for a task See probe::signal.flush(3stap) for details. get_sa_flags Returns the numeric value of sa_flags See function::get_sa_flags(3stap) for details. get_sa_flags Returns the numeric value of sa_handler See function::get_sa_flags(3stap) for details. get_sa_flags Returns the string representation of a sigset See function::get_sa_flags(3stap) for details. is_sig_blocked Returns 1 if the signal is currently blocked, or 0 if it is not See function::is_sig_blocked(3stap) for details. sa_flags_str Returns the string representation of sa_flags See function::sa_flags_str(3stap) for details. sa_handler Returns the string representation of an sa_handler See function::sa_handler(3stap) for details. signal_str Returns the string representation of a signal number See function::signal_str(3stap) for details. SEE ALSO
function::get_sa_flags(3stap), function::get_sa_flags(3stap), function::get_sa_flags(3stap), function::is_sig_blocked(3stap), function::sa_flags_str(3stap), function::sa_handler(3stap), function::signal_str(3stap), probe::signal.send(3stap), probe::signal.send.return(3stap), probe::signal.checkperm(3stap), probe::signal.checkperm.return(3stap), probe::signal.wakeup(3stap), probe::signal.check_ignored(3stap), probe::signal.check_ignored.return(3stap), probe::signal.force_segv(3stap), probe::signal.force_segv.return(3stap), probe::signal.syskill(3stap), probe::signal.syskill.return(3stap), probe::signal.sys_tkill(3stap), probe::signal.systkill.return(3stap), probe::signal.sys_tgkill(3stap), probe::signal.sys_tgkill.return(3stap), probe::signal.send_sig_queue(3stap), probe::signal.send_sig_queue.return(3stap), probe::signal.pending(3stap), probe::signal.pending.return(3stap), probe::signal.handle(3stap), probe::signal.handle.return(3stap), probe::signal.do_action(3stap), probe::signal.do_action.return(3stap), probe::signal.procmask(3stap), probe::signal.procmask.return(3stap), probe::signal.flush(3stap), stap(1), stapprobes(3stap) IBM
--- tapset::signal(3stap)
All times are GMT -4. The time now is 01:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy