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
It is giving me an output like this...
But I want 0's and not blank space in between Comma.
Also please tell me if there is a way if I can use variables inside the Awk By which i mean
is not working , because it is taking the value of the $l field from the file
Last edited by Franklin52; 02-21-2012 at 03:19 AM..
Reason: Please use code tags for code and data samples, thank you
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)
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)
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)
Hallo,
i have a file which looks like this:
$1 $2 $3
Student1 55 Pass
55 Pass
35 Fail
Student2 55 Pass
55 Pass
35 Fail
i want that the $1 field... (3 Replies)
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)
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)
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)
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)
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)