Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Identifying the first line that has zeros Post 302536455 by cosmologist on Tuesday 5th of July 2011 12:21:40 PM
Old 07-05-2011
Identifying the first line that has zeros

If I have a file like:

Code:
9350.  0.288426
9370.  0.320469
9390.  0.394475
9410.  0.353157
9430.  0.336001
9450.  0.336692
9470.  0.356827
9490.  0.359891
9510.  0.346305
9530.  0.356506
9550.  0.348306
9570.  0.36832
9590.  0.379067
9610.  0.0246704
9630.  0
9650.  0
9670.  0
9690.  0
9710.  0
9730.  0
9750.  0
9770.  0
9790.  0
9810.  0
9830.  0
9850.  0
9870.  0
9890.  0
9910.  0
9930.  0
9950.  0

And I want to automatically find the line where column 2 is a starts to be zero (in this case = 15) how can I do that?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

identifying duplicates line & reporting their line number

I need to find to find duplicate lines in a document and then print the line numbers of the duplicates The files contain multiple lines with about 100 numbers on each line I need something that will output the line numbers where duplicates were found ie 1=5=7, 2=34=76 Any suggestions would be... (5 Replies)
Discussion started by: stresslog
5 Replies

2. Shell Programming and Scripting

Leading zeros

How to insert leading zeros into a left-justisfied zip code? e.g. Zip code is written as 60320 which is left-justified to make it be read as 0060320. We have to move it to right-justifiable then insert 2 leading zeros into it... ;) (1 Reply)
Discussion started by: wtofu
1 Replies

3. UNIX for Dummies Questions & Answers

pad Zeros

Hi can I know command to pad Zeros to a value I get 16 and I need to send 0000000016 (5 Replies)
Discussion started by: mgirinath
5 Replies

4. Shell Programming and Scripting

Pad zeros to a number

Pad zeros to a number and assign it to a variable like i get 1 in $i ,i want it to be $i as 01 (6 Replies)
Discussion started by: anumkoshy
6 Replies

5. UNIX for Dummies Questions & Answers

Left filled with zeros

Hi A question about numeric display there... Is there any option in awk that would prints a number with "left filled with zero" format, and how does it work with variable length definition? For instance IŽd like my variable to be left filled with 0s for a length of 3 in total: 4 would be... (3 Replies)
Discussion started by: Indalecio
3 Replies

6. UNIX for Advanced & Expert Users

trimming zeros

Hi, I want to trim +with leading zero's with amount fields.I know using awk for trimming leading zeros with +,but I want get the entire row itself. cat file_name |awk -F " " '{printf "%14.4f%f\n",$4}' ex: 10 xyz bc +00000234.4500 20 yzx foxic +002456.000 Expexted 10 xyz bc... (3 Replies)
Discussion started by: mohan705
3 Replies

7. Shell Programming and Scripting

Padding with zeros.

Hi Friends, I would like to left pad with "0's" on first column say (width six) I have a large file with the format: FILE: 1: ALFRED 84378 NY 8385: JAMES 88385 FL 323: SMITH 00850 TX My output needs to be like: 000001: ALFRED 84378 NY 008385: JAMES 88385 FL 000323: SMITH... (10 Replies)
Discussion started by: sbasetty
10 Replies

8. Shell Programming and Scripting

tr command to delete zeros

Hi, I have a input string 0000106 I need to extract the number after leading zeros ie the number 106. I used the command tr -d "0" and got the output as 16. Could any one of you please help me in using the tr command to get the output 106. Thanks in advance.... (2 Replies)
Discussion started by: dean_amrita
2 Replies

9. Shell Programming and Scripting

Script for identifying and deleting dupes in a line

I am compiling a synonym dictionary which has the following structure Headword=Synonym1,Synonym2 and so on, with each synonym separated by a comma. As is usual in such cases manual preparation of synonyms results in repeating the synonym which results in dupes as in the example below:... (3 Replies)
Discussion started by: gimley
3 Replies

10. Shell Programming and Scripting

Identifying a sentence and putting it on a new line

I am revisiting the problem of sentence splitting. I have a Perl Script which splits a para into sentences, but acronyms and short forms create an issue #!/usr/bin/perl use feature qw/say/; use strict; use warnings; my $s; my @arr; while(<>) { chomp $_; $s .= $_ . " "; } @arr... (2 Replies)
Discussion started by: gimley
2 Replies
Locale::Codes::LangVar(3)				User Contributed Perl Documentation				 Locale::Codes::LangVar(3)

NAME
Locale::Codes::LangVar - standard codes for language variation identification SYNOPSIS
use Locale::Codes::LangVar; $lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic' $code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langvar_codes(); @names = all_langvar_names(); DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language variations. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lvar = code2langvar('arevela','alpha'); $lvar = code2langvar('arevela',LOCALE_LANGVAR_ALPHA); The codesets currently supported are: alpha This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian. This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA". This is the default code set. ROUTINES
code2langvar ( CODE [,CODESET] ) langvar2code ( NAME [,CODESET] ) langvar_code2code ( CODE ,CODESET ,CODESET2 ) all_langvar_codes ( [CODESET] ) all_langvar_names ( [CODESET] ) Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] ) Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME ) Locale::Codes::LangVar::delete_langvar_alias ( NAME ) Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::delete_langvar_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-04-12 Locale::Codes::LangVar(3)
All times are GMT -4. The time now is 09:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy