Sponsored Content
Top Forums Shell Programming and Scripting Print rows with value zero or less than zero using awk Post 302938036 by quincyjones on Wednesday 11th of March 2015 01:28:17 PM
Old 03-11-2015
want to print rows that has zeroes

Code:
na t1  t2  t3  t4  t5  t6  t7
l1  0  0  0  0  0  0  0

---------- Post updated at 12:28 PM ---------- Previous update was at 11:53 AM ----------

real example
Code:
g
g1      0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000    0.000000 0.000000        0.344063        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000    0.000000 0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000    0.000000 0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000    0.000000 0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000    0.000000 0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000    0.000000 0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.216579        0.000000        0.000000        0.000000    0.000000 0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.000000        0.00000

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print selected rows with awk

Hi everybody: Could anybody tell me how I can print from a file a selected rows with awk. In my case I only want print in another file all the rows from NR=8 to NR=2459 and the increment each 8 times. I tried to this: awk '{for (i=8; i=2459; i+=8); NR==i}' file1 > file2 But doesn't... (6 Replies)
Discussion started by: tonet
6 Replies

2. Shell Programming and Scripting

want to print output if u have rows and columns

U have a file File 1 0.3 0.2 0.4 0.3 0.8 0.11 0.22 0.4 0.23 0.45 0.56 0.78 0.98 0.11 0.32 0.2 0.4 0.45 0.54 0.2 0.33 0.44 0.21 0.22 0.98 0.8 0.2 0.34 0.54 0.98 0.12 0.1 0.22 0.32 0.34 0.89 0.22 File 2 rows columns 3 1 2 3 4 2 5 ... (8 Replies)
Discussion started by: cdfd123
8 Replies

3. UNIX for Advanced & Expert Users

Print rows into columns

Hi, I required to print all rows into columns(some comma separated or else) till a pattern match found. Using Solaris UNIX scripting my input is like abc def ghi jkl mno END pqr stu vwx yz 123 END ... ... (7 Replies)
Discussion started by: vikash.rastogi
7 Replies

4. UNIX for Dummies Questions & Answers

search one row and print next 9 rows

Hi, I'd like your support on this, my file looks like this: 25 50 200 10 0 1 10 6 12 17 26 24 30 319 10 -0.83 3.31 270.646 12.48 -163.04 30.38 0 0 0 -2.88 0.64 16.06 34.4 33.08 34.4 33.08 34.06 20.48 6.22 -33.39 33.96 -33.5840381 -71.6177759 -163.26 25.59 34.1 -28.8 -5.6 -9.9 0 0 0 0... (3 Replies)
Discussion started by: Gery
3 Replies

5. UNIX for Dummies Questions & Answers

Print individual rows.

Hi all, I have a file im reading with a for loop using: for i in $(cat filename) do etc. done the original file is 3 columns, this method prints it out into 3 rows, and i would like to just assign the first to rows (originally first two columns) to separate variables. What would be... (3 Replies)
Discussion started by: jgrosecl
3 Replies

6. UNIX for Dummies Questions & Answers

Awk: Print out overlapping chunks of file - rows 0-20,10-30,20-40 etc.

First time poster, but the forum has saved my bacon more times than... Lots. Anyway, I have a text file, and wanted to use Awk (or any other sensible program) to print out overlapping sections, or arbitrary length. To describe by example, for file 1 2 3 4 5 etc... I want the out put... (3 Replies)
Discussion started by: matfald
3 Replies

7. Shell Programming and Scripting

awk command to print only selected rows in a particular column specified by column name

Dear All, I have a data file input.csv like below. (Only five column shown here for example.) Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 3,2,4,5,6 5,3,5,5,6 From this I want the below output Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 where the second column... (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Print various rows in one row

I have this in a file 11.22.33.44 yyyyyyuser With awk/sed, I need this to be output as follows alias server.domain.com='ssh yyyyyyuser@11.22.33.44' (4 Replies)
Discussion started by: anil510
4 Replies

9. Shell Programming and Scripting

Print rows based on separator

For below lines in a file. 68078971 dance routine (jess far back corner) 13902786 368079527 dance routine 13902786 368081191 dance routine (jess far back) 13902786 I am looking for output as below 68078971, "dance routine (jess far back corner)", 13902786... (4 Replies)
Discussion started by: Anjan1
4 Replies

10. Shell Programming and Scripting

Awk- Indexing a list of numbers in file2 to print certain rows in file1

Hi Does anyone know of an efficient way to index a column of data in file2 to print the coresponding row in file1 which corresponds to the data in file2 AND 30 rows preceding and after the row in file1. For example suppose you have a list of numbers in file2 (single column) as follows:... (6 Replies)
Discussion started by: Geneanalyst
6 Replies
Table(3)						User Contributed Perl Documentation						  Table(3)

NAME
Tk::Table - Scrollable 2 dimensional table of Tk widgets SYNOPSIS
use Tk::Table; $table = $parent->Table(-rows => number, -columns => number, -scrollbars => anchor, -fixedrows => number, -fixedcolumns => number, -takefocus => boolean); $widget = $table->Button(...); $old = $table->put($row,$col,$widget); $old = $table->put($row,$col,"Text"); # simple Label $widget = $table->get($row,$col); $cols = $table->totalColumns; $rows = $table->totalRows; $table->see($widget); $table->see($row,$col); ($row,$col) = $table->Posn($widget); DESCRIPTION
Tk::Table is an all-perl widget/geometry manager which allows a two dimensional table of arbitary perl/Tk widgets to be displayed. Entries in the Table are simply ordinary perl/Tk widgets. They should be created with the Table as their parent. Widgets are positioned in the table using: $table->put($row,$col,$widget) If $widget is not a reference it is treated as a string, and a Lable widget is created with the string as its text. All the widgets in each column are set to the same width - the requested width of the widest widget in the column. Likewise, all the widgets in each row are set to the same height - the requested height of the tallest widget in the column. A number of rows and/or columns can be marked as 'fixed' - and so can serve as 'headings' for the remainder the rows which are scrollable. The requested size of the table as a whole is such that the number of rows specified by -rows (default 10), and number of columns specified by -columns (default 10) can be displayed. If the Table is told it can take the keyboard focus then cursor and scroll keys scroll the displayed widgets. The Table will create and manage its own scrollbars if requested via -scrollbars. The table can be emptied using $table->clear the widgets which were in the table are destroyed. The Tk::Table widget is derived from a Tk::Frame, so inherits all its configure options. BUGS
/ Snags / Possible enhancements o Very large Tables consume a lot of X windows. o No equivalent of pack's -anchor/-pad etc. options SEE ALSO
Tk::grid, Tk::HList, Tk::TableMatrix, Tk::MListbox, Tk::Columns perl v5.12.1 2007-11-08 Table(3)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy