Question about sort specific column and print other column at the same time !
Hi,
This is my input file:
My desired output:
Based on the column two, I want to do the descending order and print out other related column at the same time.
Does anybody know how to do it?
I'm not sure whether awk can do this or not?
Thanks for all of your suggestion
Hi,
I need to sort it by column or need it in a specific order...
input is
=====
uid=shashi country= india region =0 ph=0
uid= jon region= asia ph= 12345 country=0
uid = man country= india ph=2222 region=0
uid= neera region= asia ph= 125 country=0
output should be
uid=shashi ... (1 Reply)
Hi
I want to print column2 if column1 is b with:
awk '$1==b {print $2}' infile > outfile
infile
a 1
b 2
c 3
b 4
e 5
b 6
the outfile is empty.
it should look like this:
2
4
6 (2 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hello....
Pls help me (and sorry my english) :)
So
I have a file (test.txt) with 1 long line.... for example:
isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh
How to print after the "error" word the 2nd 4th 5th and 7th word??
output well be:
653 isfbisfb... (2 Replies)
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
LEARN ABOUT PLAN9
pr
PR(1) General Commands Manual PR(1)NAME
pr - print file
SYNOPSIS
pr [ option ... ] [ file ... ]
DESCRIPTION
Pr produces a printed listing of one or more files on its standard output. The output is separated into pages headed by a date, the name
of the file or a specified header, and the page number. With no file arguments, pr prints its standard input.
Options apply to all following files but may be reset between files:
-n Produce n-column output.
+n Begin printing with page n.
-b Balance columns on last page, in case of multi-column output.
-d Double space.
-en Set the tab stops for input text every n spaces.
-h Take the next argument as a page header (file by default).
-in Replace sequences of blanks in the output by tabs, using tab stops set every n spaces.
-f Use formfeeds to separate pages.
-ln Take the length of the page to be n lines instead of the default 66.
-m Print all files simultaneously, each in one column.
-n Number the lines of each file.
-on Offset the left margin n character positions.
-sc Separate columns by the single character c instead of aligning them with white space. A missing c is taken to be a tab.
-t Do not print the 5-line header or the 5-line trailer normally supplied for each page.
-wn For multi-column output, take the width of the page to be n characters instead of the default 72.
SOURCE
/sys/src/cmd/pr.c
SEE ALSO cat(1), lp(1)PR(1)