Sponsored Content
Top Forums Shell Programming and Scripting AWK processing -numbers to another column Post 302364050 by BeJay on Thursday 22nd of October 2009 01:26:25 AM
Old 10-22-2009
That is perfect Scrutinizer Smilie

I didn't know you could use if/then statements in AWK, so that makes it much easier to understand. I've been bashing my head for quite a while Smilie

Thanks again!

Bj
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

processing matrix column wise

I have a m X n matrix written out to file, say like this: 1,2,3,4,5,6 2,6,3,10,34,67 1,45,6,7,8,8 I want to calculate the column averages in the MINIMUM amount of code or processing possible. I would have liked to use my favorite tool, "AWK" but since it processes rowwise, getting the... (5 Replies)
Discussion started by: Abhishek Ghose
5 Replies

2. UNIX for Dummies Questions & Answers

Increasing numbers in Column

I have UWIn version of Unix for Desktop. I have a file (Subtitle file of a movie) with the following format abc def ghi jkl mno pqr stuv uvw xyz The subtitles are delayed about a min or few seconds more. I want to increase it to be as shown below: abc def ghi jkl mno pqr stuv ... (4 Replies)
Discussion started by: bobbygsk
4 Replies

3. Shell Programming and Scripting

trying to make an AWK code for ordering numbers in a column from least to highest

Hi all, I have a large column of numbers like 5.6789 2.4578 9.4678 13.5673 1.6589 ..... I am trying to make an awk code so that awk can easily go through the column and arrange the numbers from least to highest like 1.6589 2.4578 5.6789 ....... can anybody suggest, how can I do... (5 Replies)
Discussion started by: ananyob
5 Replies

4. Shell Programming and Scripting

Processing text variables that have numbers in CShell

Hello, I have a case where I need to process an environment variable text value in CShell to calculate the product of 2 numbers stated in the variable string having the format "<first_number>Letter x<second_number>". Ex: $VAR = "24x20" I need to set $VAR_PRODUCT = "Product of 20 and 24"... (3 Replies)
Discussion started by: mohy
3 Replies

5. Programming

AWK processing of a three-column file

I have a 3-column data file, for which I wish to print certain parts of $3 PHI PSI A(x) -177.5 -177.5 1.0625 -177.5 -172.5 0.55 -177.5 -167.5 0.0478125 -177.5 -162.5 0 -177.5 -157.5 0.284375 -177.5 -152.5 0.187188 -177.5 -147.5 0.236875 -177.5 -142.5 0.383438 -177.5 ... (3 Replies)
Discussion started by: chrisjorg
3 Replies

6. Shell Programming and Scripting

Help with File processing - Extracting the column

I have a line from table space report: 5 135_TT ms Normal 1774336.0 1774208.0 761152.0 1013056.0 57.1% Now I have to get 1013056.0 as o/p. For this I tried cut -f32 -d" " previously it worked now it is showing empty space. Suggest me the best code for this which... (1 Reply)
Discussion started by: karumudi7
1 Replies

7. Shell Programming and Scripting

AWK "make a new column that include increasing numbers"

please help!!!!!! I have a file .txt that has only one column like that: 34.1 35.5 35.6 45.6 ... Now, i want to add a column in the left in which the values of this column increase by 0.4 , for example: 0.0 34.1 0.4 35.5 0.8 35.6 1.2 45.6 How can i do with awk instructions??? ... (2 Replies)
Discussion started by: tienete
2 Replies

8. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

9. Shell Programming and Scripting

Help with awk script to get missing numbers in column 1

Hello to all, I have show below a file separated by commas. In first column has numbers where the last number is 13. 1,4 2,6 3,7 5,2 6,5 7,5 8,65 9,10 11,78 13,2 What I want to know is which numbers are missing from 1 to 13 (in this case 13 is last number in column 1). My real... (17 Replies)
Discussion started by: Ophiuchus
17 Replies

10. Shell Programming and Scripting

Use awk to replace numbers in a file with a column from another file

Hello, I am trying to make a awk code that will take 2 files, a txt file like this : 1 1 88 c(1:38, 42, 102) 2 2 128 c(39:41, 43:101, 103:105, 153, 155:189, 292, 344:369) 3 3 84 c(190:249, 603, 606:607, 609:629) 4 4 12 ... (8 Replies)
Discussion started by: nastaziales
8 Replies
HTML::Template::Dumper(3pm)				User Contributed Perl Documentation			       HTML::Template::Dumper(3pm)

NAME
HTML::Template::Dumper - Output template data in a test-friendly format SYNOPSIS
# Switch the module used to the regular HTML::Template when you're # finished testing # #use HTML::Template; use HTML::Template::Dumper; my $tmpl = #HTML::Template HTML::Template::Dumper ->new( . . . ); $tmpl->set_output_format( 'YAML' ) if $tmpl->isa( 'HTML::Template::Dumper' ); # Do processing for the template $tmpl->output(); DESCRIPTION
This module helps you to test HTML::Template-based programs by printing only the information used to fill-in the template data. This makes it much easier to automatically parse the output of your program. Currently, data can be outputed by "Data::Dumper" (default) or "YAML". Note that the underlieing HTML::Template methods are still called, so options like "strict" and "die_on_bad_params" will still throw errors. USAGE
new Called just like the "HTML::Template->new()" method. set_output_format $tmpl->set_output_format( 'YAML', @extra_params ); Set the output format. Currently known formats are: Format Name Module ------------- -------- Data_Dumper HTML::Template::Dumper::Data_Dumper YAML HTML::Template::Dumper::YAML The module is found by applying the following rules: 1. If the name has a "::" anywhere, then it is taken as the full name of the module. 2. Otherwise, the module is loaded from "HTML::Template::Dumper::$NAME", where $NAME is what you passed to "set_output_format". 3. If the name didn't have a "::" in it, but it didn't pass rule #2, then take it as the full name of the module. 4. If none of the above work, then call "die". In any of the cases, the module returned must inheirt from "HTML::Template::Dumper::Format". Otherwise, "die" is called. Any parameters you pass after the format will be put directly into the formatter's "new()" method. output Called just like the regular "HTML::Template->output()", but will return a simplified view of the template data instead of the full object. The "print_to" parameter is respected as specified in the "HTML::Template" documentation. set_output_filter Called with a reference to a subroutine. Before "output" returns, this subroutine will be called with a scalar reference to the data that would otherwise have been directly returned by "output". Your filter subroutine can do any modification on the value it wants. For instance, if you want the output to be (almost) valid HTML, you could write: $tmpl->set_output_filter( sub { my $ref = shift; $$ref = q{ <html> <head> <title>Debugging Output</title> </head> <body bgcolor="#FFFFFF"> <pre> } . $$ref . q{ </pre> </body> </html> } }); Note that the result may or may not work with "parse", depending on your filter and the format used by your dumper. parse Called with the data that was returned by "output()". Returns a hashref of all the parameters. This can also be called as a class method, in which case it can take a second paramter containing the data format that the first paramter is in. This second parameter has the same rules applied to it as "set_output_format()". WRITING NEW FORMATTERS
Formaters must inheirt from "HTML::Template::Dumper::Format". There are two methods that need to be overridden. new Not called with anything. Returns a blessed reference. The default implementation blesses a scalar reference in order to save a little memory. This should be sufficient for most formatters, but you can always override this method if you need it. dump All formatters must override this method. It is called with a single reference which is formatted and returned. parse All formaters must override this method. It is called with a single scalar that holds the complete data returned by this formatter's "dump" method. It returns a hashref of all the parameters held in that dump. BUGS
Yes. AUTHOR
Timm Murray <tmurray@agronomy.org> http://www.agronomy.org CPAN ID: TMURRAY COPYRIGHT
Copyright 2003, American Society of Agronomy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the "Artistic License" which comes with Perl. SEE ALSO
perl(1). HTML::Template(3). Data::Dumper(3). YAML(3). perl v5.10.1 2010-04-26 HTML::Template::Dumper(3pm)
All times are GMT -4. The time now is 09:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy