Could you please try following and let me know if this helps you. Let's say we have following Input_file.
Then following code may help us to achieve as your request.
Output will be as follows.
Thanks,
R. Singh
Last edited by RavinderSingh13; 01-08-2016 at 10:47 AM..
Reason: Added an example file and output to my post now.
Here is the code I'm using
{
printf("%11d %4.2f\% %4.2f\%\n", $1,$2,$3);
}
I want the output to look something like
1235415234 12.24% 52.46%
Instead it looks something like
319203842 42.27\%4.2f\%
How do I just print a "%" without awk or printf thinking I'm trying to do... (1 Reply)
Hey. This is pretty easy stuff but I'm learning the basics of Unix at the moment so keep that in mind. I have to:
1) Write a C-shell script to monitor user activity on the server for 13 minutes.
2) Then print the smallest and largest number of users during these 13 minutes.
I have this:
1)... (2 Replies)
Hello all, I have a bash function that opens Safari (I'm on OS X) with a specified argument.
Here it is :
function safari
{
#Safari bash function
TLDS=( "http://www." ".com" ".org" ".net" ".gov" ".edu" )
if ; then
open -a Safari ${TLDS}$2${TLDS}
elif ; then
open -a Safari... (0 Replies)
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Hey,
This is a long-shot however, I am stuck with the following problem:
I have the output from ls -la, and I want to sort some of that data out by using AWK to filter it.
ls -la | awk -f scriptname.awk
Input:
For example:
drwxr-xr-x 3 user users 4096 2010-03-14 20:15 bin/... (5 Replies)
Hi,
Anybody know how to print out the record that shown smallest number among column 3 and column 4
Case 1 Input :
37170 37196 77 51
37174 37195 73 52
37174 37194 73 53
Case 1 Output :
37170 37196 77 51
Case 2 Input :
469613 469660 73 ... (4 Replies)
Hello,
I have often found bash to be difficult when it comes to floating point numbers. I have data with rows of tab delimited floating point numbers. I need to find the smallest number in each row that is not 0.0. Numbers can be negative and they do not come in any particular order for a given... (9 Replies)