I would like to assign the following values to each column in my file.
if $i is between 1 and -1 (ie -1 < $i < 1) then print A;
if $i is between -2 and -1 && 1 and 2 (ie. -2 < $i < -1 && 1 < $i < 2) then print B;
if $i is between -3 and -2 && 2 and 3 (ie. -3 < $i < -2 && 2 < $i < 3) then print C;
else print D;
for this i used the following code
I am getting the output, but its printing only A and D; but there are some value which are in the range of B and C. But its not printing B and C, instead its printing D.
Can anyone help me in this regard?
Expecting your reply and thanks in advance.
Warm regards
Fredrick.
Last edited by vbe; 02-19-2010 at 12:21 PM..
Reason: beautify... (what is in code tags...)
if the column1 and 2 in both files has same key (for example "a" and "a1") compare each first key value(a1 of a) of input2 (for example 1-4 or 65-69 not 70-100 or 44-40 etc) with all the values in input1.
if the range of first key value in input2 is outof range in input1 values named it as out... (54 Replies)
Hi,
I've a file with some coloumns (separated by coma) and some lines, like so:
A,B,C,D
1,2,3,4
5,6,7,8
9,1,2,3
I want to print a range of coloumns: for example all coloumns between the coloumn with the charachter B in the first line, and the coloumn with the char D in the first... (5 Replies)
Hi Gurus,
I have to fetch the records from a logs as per the time stamp . I am comfortable to use awk and sed in the script . But the logic to fetch the records as per comparison is the problem. $cat my_log.log
<Jul 30, 2010 7:01:12 AM EEST> <Error> <WebLogicServer>
<Jul 30, 2010 8:04:12 AM... (3 Replies)
I have this kind of file
ABC UUIIIIIIIIIIII ,
HJHKJKL
XYZ HHJJJJJJMMM
ABC BBOOIO,
PPLIOJK
XYZ NMJKJKK
ABC MMMM
ABC OPOPO
XYZ LLKLKLL
I need to get all data from ABC till XYZ
so output should be
UUIIIIIIIIIIII (6 Replies)
Hi All,
I am new to awk command and I had a question in using it.
I want to filter a code file and print specific functions (that contain menu word in the function name).
for example, if the file has:
function menu1()
{
}
function f2()
{
}
function menu3()
{
}so I want... (5 Replies)
Hi all,
I am having a bit of a hard time using awk. I must do something wrong, but I don't know what... Any help would be greatly appreciated!
I read a file, as follows :...
ATOM 21 C THR A 4 23.721 -26.194 1.909 1.00 32.07 C
ATOM 22 O THR A 4 ... (2 Replies)
I was reading about different methods of awk field ranges. Does the second method have any advantage? Its quite a bit longer so I am wondering what the advantage is.
awk '{for(i=5;i<=9;i++)printf "%s ",$i;print ""}' filename ... (2 Replies)
To match range, the command is:
awk '/BEGIN/,/END/'
but what I want is the range is printed only if there is additional pattern that matches in the range itself? maybe like this:
awk '/BEGIN/,/END/ if only in that range there is /pattern/'
Thanks (8 Replies)
I want to print specific range of rows and then its columns using awk command.
lets say if a file contain 15 line then i need to print line 5 to 9.
awk '{print;for( NR>=5&&NR<=9); do; print "<tr>\n<td>"$1"</td><td>"$2"</td><td>"$3"</td>\n</tr" done}' xyz.csv
not sure what's wrong... (9 Replies)
I am trying to update the below awk, kindly provided by @RavinderSingh13, to update each line of file1 with either Low or No Low based on matching $2 of file1 to a range in $2 and $3 of file2. If the $2 value in file1 matches the range in file2 then that line is Low, otherwise it is No Low in the... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT LINUX
lpshut
lpshut(1M) System Administration Commands lpshut(1M)NAME
lpshut - stop the LP print service
SYNOPSIS
lpshut
DESCRIPTION
The lpshut command stops the LP print service.
Printers that are printing when lpshut is invoked stop printing. Start or restart printers using lpsched(1M).
EXIT STATUS
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
FILES
/var/spool/lp/* LP print queue.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWpsu |
+-----------------------------+-----------------------------+
SEE ALSO lp(1), lpstat(1), lpadmin(1M), lpmove(1M), lpsched(1M), attributes( 5)
System Administration Guide: Basic Administration
SunOS 5.10 8 Jan 1998 lpshut(1M)