10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The awk below executes and produces the current output. it skips the header in row 1 and prints $4,$5,$6 and then adds the header row back.
The problem is that it keeps the tailing tab and prints it in front of $1. I could add a pipe to remove the tab, but is there a better way to do it with on... (7 Replies)
Discussion started by: cmccabe
7 Replies
2. Shell Programming and Scripting
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
3. Shell Programming and Scripting
Hi,
I need to search for a word using Awk and print out the line the word is in and every line after the search phrase until I hit this #------------. Then I need to send it to a csv file.
So basically the input file format is like this:... (1 Reply)
Discussion started by: An0mander
1 Replies
4. UNIX for Dummies Questions & Answers
Hi folks,
I am very new to awk. I have what is probably a very simple question. I'm trying to get the max value of column 1, but also print column 2. My data looks like this:
0.044|2000-02-03 14:00:00
5.23|2000-02-03 05:45:00
5.26|2000-02-03 11:15:00
0|2000-02-01 18:30:00
So in this case... (2 Replies)
Discussion started by: amandarobe
2 Replies
5. Shell Programming and Scripting
Hi there,
I'm trying to use awk to print out the entire line that contains a match to a certain regex and then append some text,plus the match to the end of the line.
So far I have:
awk -F: '{print "RG:Z:" $2}' file
Which prints out the match I want plus the additional text, but I'm stuck... (3 Replies)
Discussion started by: jim_lad
3 Replies
6. Shell Programming and Scripting
Hi Experts,
I want to print this charts diagonal data into straight lines.
This is a matrix 24X24 Horizontal and vertical.
- I want to print all the diagonal cutting characters into straight line:
Data:
E F S S A H A L L A T M C N O T S O B O D U Q H
I W I B N L O C N I L N L A N S I N... (9 Replies)
Discussion started by: rveri
9 Replies
7. Shell Programming and Scripting
Hi ,
I have inserted some records in a table having column "value1 varchar2(4000)" and want to spool in a file.
I have written as below
set echo off
set feed off
set hea off
set wra off
set lin 500
spo temp_table
and fired select query as below
select value1 from temp_table;
spo... (6 Replies)
Discussion started by: CaapAjayShukla
6 Replies
8. Shell Programming and Scripting
friends, i am a newbie in scripting. could someone help me in selecting only the last column of below ps command output ?
mqm 14 16466 0 Sep 15 ? 0:01 /opt/mqm/bin/runmqlsr -r -m QMGR.INBOUNDSSL -t TCP -p 1415 -i 5.1.26.5
mqm 12 16700 0 Sep 15 ? 0:00... (4 Replies)
Discussion started by: unahb1
4 Replies
9. Shell Programming and Scripting
Hi,
I have a script that fetches only specific information from fcinfo command. Below is a portion of the script.
#!/usr/bin/ksh
set -x
HBA_COUNT=`sudo fcinfo hba-port | grep -i state | awk 'END{print NR}'`
echo "$HBA_COUNT HBAs exist"
echo '........'
INDEX=1
while $INDEX -le... (2 Replies)
Discussion started by: jake_won
2 Replies
10. Shell Programming and Scripting
Hi Chaps,
I'm trying to print the line number of a comma delimited file where the second field in the line is blank using AWK. Here is the code I have so far where am I going wrong. It is the last column in the file.
nawk -v x==0 'BEGIN {FS=",";OFS=","} x++ if ($2 == " ") print $x' bob.tst
... (3 Replies)
Discussion started by: rjsha1
3 Replies