Sponsored Content
Top Forums Shell Programming and Scripting Print smallest negative number with corresponding index from a column Post 302770006 by Scrutinizer on Thursday 14th of February 2013 06:23:07 AM
Old 02-14-2013
How about combining it with the other test:
Code:
awk '$3<1 && $5<m { m=$5; s=$1 OFS $3 OFS $5 } END{ print s }' file

(BTW, col4 = $5)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

checking the smallest and largest number

Hi All, My script is reading a log file line by line log file is like ; 19:40:22 :INFO Total time taken to Service External Request---115ms 19:40:25 DEBUG : Batch processed libdaemon.x86_64 0-0.10-5.el5 - u 19:40:22 INFO Total time taken to Service External Request---20ms 19:40:24... (4 Replies)
Discussion started by: subin_bala
4 Replies

2. UNIX for Dummies Questions & Answers

How to print largest and smallest number.

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)
Discussion started by: amp10388
2 Replies

3. Shell Programming and Scripting

How to print column based on row number

Hi, I want to print column value based on row number say multiple of 8. Input file: line 1 67 34 line 2 45 57 . . . . . . line 8 12 46 . . . . . . line 16 24 90 . . . . . . line 24 49 67 Output 46 90 67 (2 Replies)
Discussion started by: Surabhi_so_mh
2 Replies

4. Shell Programming and Scripting

Taking largest (negative) number from column of coordinates and adding positive form to every other

Hello all, I'm new to the forums and hope to be able to contribute something useful in the future; however I must admit that what has prompted me to join is the fact that currently I need help with something that has me at the end of my tether. I have a PDB (Protein Data Bank) file which I... (13 Replies)
Discussion started by: crunchgargoyle
13 Replies

5. Shell Programming and Scripting

Use a string in one column to get the largest or the smallest of another column

I have data that looks like this: chr1 mm9_knownGene exon 155747075 155747189 0.000000 + . gene_id "Glul"; transcript_id "uc007daq.1"; chr1 mm9_knownGene exon 155750064 155750076 0.000000 + . gene_id "Glul";... (3 Replies)
Discussion started by: pbluescript
3 Replies

6. Shell Programming and Scripting

Help with compare two column and print out column with smallest number

Input file : 5 20 500 2 20 41 41 0 23 1 Desired output : 5 2 20 0 1 By comparing column 1 and 2 in each line, I hope can print out the column with smallest number. I did try the following code, but it don't look good :( (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. Shell Programming and Scripting

Problem to print out record got smallest number in specific column

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)
Discussion started by: cpp_beginner
4 Replies

8. Shell Programming and Scripting

Problem facing to compare different column and print out record with smallest number

Hi, Input file 1 : 37170 37196 77 51 37174 37195 73 52 37174 37194 73 53 Desired Output file 1 : 37170 37196 77 51 Input file 2 : 37174 37195 73 0 37170 37196 77 0 Desired Output file 2 : 37174 37195 73 0 (1 Reply)
Discussion started by: cpp_beginner
1 Replies

9. Shell Programming and Scripting

awk - Print column number that return value comes from

I have the following awk script that I am using to find the max value in the file and print results. awk 'BEGIN {MAX=-1E100} {for (x=2; x<=NF; x++) if ($x>MAX) {MAX = $x; C1 = $1}} END {print substr(C1,1,11), substr(C1,13,4), substr(C1,18,2), MAX}' ABC* Input (ABC*) ... (6 Replies)
Discussion started by: ncwxpanther
6 Replies

10. Shell Programming and Scripting

Bash script to print the smallest floating point number in a row that is not 0

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)
Discussion started by: LMHmedchem
9 Replies
LaTeX::Encode(3pm)					User Contributed Perl Documentation					LaTeX::Encode(3pm)

NAME
LaTeX::Encode - encode characters for LaTeX formatting SYNOPSIS
use LaTeX::Encode; $latex = latex_encode($text, %options); VERSION
This manual page describes version 0.03 of the "LaTeX::Encode" module. DESCRIPTION
This module provides a function to encode text that is to be formatted with LaTeX. It encodes characters that are special to LaTeX or that are represented in LaTeX by LaTeX commands. The special characters are: "" (command character), "{" (open group), "}" (end group), "&" (table column separator), "#" (parameter specifier), "%" (comment character), "_" (subscript), "^" (superscript), "~" (non-breakable space), "$" (mathematics mode). Note that some of the LaTeX commands for characters are defined in the LaTeX "textcomp" package. If your text includes such characters, you will need to include the following lines in the preamble to your LaTeX document. usepackage[T1]{fontenc} usepackage{textcomp} The function is useful for encoding data that is interpolated into LaTeX document templates, say with "Template::Plugin::Latex" (shameless plug!). SUBROUTINES
/METHODS "latex_encode($text, %options)" Encodes the specified text such that it is suitable for processing with LaTeX. The behaviour of the filter is modified by the options: "except" Lists the characters that should be excluded from encoding. By default no special characters are excluded, but it may be useful to specify "except = "\{}"" to allow the input string to contain LaTeX commands such as "this is \textbf{bold} text" (the doubled backslashes in the strings represent Perl escapes, and will be evaluated to single backslashes). "iquotes" If true then single or double quotes around words will be changed to LaTeX single or double quotes; double quotes around a phrase will be converted to "``" and "''" and single quotes to "`" and "'". This is sometimes called "intelligent quotes" "use_textcomp" By default the "latex_encode" filter will encode characters with the encodings provided by the "textcomp" LaTeX package (for example the Pounds Sterling symbol is encoded as "\textsterling{}"). Setting "use_textcomp = 0" turns off these encodings. NOT YET IMPLEMENTED EXAMPLES
The following snippet shows how data from a database can be encoded and inserted into a LaTeX table, the source of which is generated with "LaTeX::Table". my $sth = $dbh->prepare('select col1, col2, col3 from table where $expr'); $sth->execute; while (my $href = $sth->fetchrow_hashref) { my @row; foreach my $col (qw(col1 col2 col3)) { push(@row, latex_encode($href->{$col})); } push @data, @row; } my $headings = [ [ 'Col1', 'Col2', 'Col3' ] ]; my $table = LaTeX::Table->new( { caption => 'My caption', label => 'table:caption', type => 'xtab', header => $header, data => @data } ); my $table_text = $table->generate_string; Now $table_text can be interpolated into a LaTeX document template. DIAGNOSTICS
None. You could probably break the "latex_encode" function by passing it an array reference as the options, but there are no checks for that. CONFIGURATION AND ENVIRONMENT
Not applicable. DEPENDENCIES
The "HTML::Entities" and "Pod::LaTeX" modules were used for building the encoding table in "LaTeX::Encode::EncodingTable", but this is not rebuilt at installation time. The "LaTeX::Driver" module is used for formatting the character encodings reference document. INCOMPATIBILITIES
None known. BUGS AND LIMITATIONS
Not all LaTeX special characters are included in the encoding tables (more may be added when I track down the definitions). The "use_textcomp" option is not implemented. AUTHOR
Andrew Ford <a.ford@ford-mason.co.uk> LICENSE AND COPYRIGHT
Copyright (C) 2007 Andrew Ford. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
Template::Plugin::Latex perl v5.10.0 2007-10-02 LaTeX::Encode(3pm)
All times are GMT -4. The time now is 03:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy