10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I have the following command which works partially:
gzcat *2016-03-25_*gz | gawk -F"|" '
BEGIN{format = "%-10s %-13s %-17s %-35s\n";
printf format, "EVENT_TYPE","RESPONSE_CODE","INTERNAL_ERR_CODE","FLOWNAME";
printf format, "----------", "-------------", "-----------------",... (6 Replies)
Discussion started by: EAGL€
6 Replies
2. Shell Programming and Scripting
Hi All
I had requirement where I need to re-order columns in a file by using a control file.
here is the ctrl file
c1
c2
c3
source file
c3 | c1 | c2
a | b| c
I should create output file based on the ctrl file columns
o/p should look like this
c1 | c2 | c3
b| c|a
I wrote some... (9 Replies)
Discussion started by: gvkumar25
9 Replies
3. UNIX for Dummies Questions & Answers
im using awk as a part of my tasks to filter out stuff for reporting details in our storage environment, supposed i filtered out these details (sorry, this might be long.)
bash$ > for x in 1 2; do symdg show floras0-snap$x | awk '{print $3,$4}'; done
: REGULAR
in GNS
Yes
:... (10 Replies)
Discussion started by: prodigy06
10 Replies
4. Shell Programming and Scripting
Hi
I am relatively new to awk so i am getting confused a lot
I am in need of help ... I am trying to append coloumns to the end of line using AWK
I tried using this command
awk -F "," '{for(s=7;s<=217;s++);$s="0";}1' OFS=, sam_sri_out
It is giving me an output like this...... (1 Reply)
Discussion started by: Sri3001
1 Replies
5. Shell Programming and Scripting
i have a file containing a line
123456
is it possible to use AWK to print it out to look like
1 2 3 4 5 6 (8 Replies)
Discussion started by: tomjones
8 Replies
6. Shell Programming and Scripting
i have a file and i want to print the second variable and add qoutes to it
i do
awk -F"|" '{print $2}' star.unl.
i get the output xxxxxxx
but i need the variable($2) to be in quotes.like
"xxxxxxx"
how do i do there please (3 Replies)
Discussion started by: tomjones
3 Replies
7. Shell Programming and Scripting
I am trying to print and delete at the same time 0KB files... using following command
a-> find . -type f | xargs ls -l | awk '{ if($5 == 0) {print $0;}}' | xargs rm $0
but am not successful. Can somebody tell me how to do this ... same time I need files to be printed as well deleted later.
... (4 Replies)
Discussion started by: vivek.gkp
4 Replies
8. Shell Programming and Scripting
Hi
awk '/print/ {print }' format.txt
the above code will search for the argument "print" and displays all the lines which contain "print" from format.txt
i want to print the same but with # as teh beginning
For eg:
format.txt contains
cat dog fire current
print the value of 4
print... (2 Replies)
Discussion started by: jisha
2 Replies
9. Shell Programming and Scripting
I am trying to print a line using awk printf command. The problem I am having is that when the string has spaces in between, it only prints the word upto the first space.
For example, if my variable has "Hello World"
The output is only "Hello".
Here is the command I am using
echo $recCtr... (2 Replies)
Discussion started by: fastgoon
2 Replies
10. Shell Programming and Scripting
Hello,
I am trying to write a formatted report into a file using .ksh script and awk. Here is the command I am trying to run
echo "before awk" ${SRC_SCHEMA}
echo | awk '{printf "%-20s", ${SRC_SCHEMA} }' >>$REPORT_SQL_NAME
I get the following error
before awk ADW
awk: 0602-562 Field $()... (1 Reply)
Discussion started by: fastgoon
1 Replies