Sponsored Content
Full Discussion: AWK end of line question
Top Forums Shell Programming and Scripting AWK end of line question Post 302157631 by jpport123 on Friday 11th of January 2008 02:14:22 PM
Old 01-11-2008
This worked great for returning just the name, but doesn't work so well with an ls -ltra for instance to show me owner and other information.

I did like the enclosed quoting - that will come in handy I'm sure...

Thanks
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk : delete ^M at the end of the line

Hi all, I'm newbi in scripting. could someone tell how to delete the ^M at the end of the linie with an awk command. many thanks in advance. (2 Replies)
Discussion started by: liliput
2 Replies

2. Shell Programming and Scripting

simple sed question - replace from phrase to end of line

I have the following line an in input file I want to digest with sed and simple replace the bold part with a variable defined in my bash script. I can do this in several sed operations but I know there must be a way to do it in a single sed line. What is the syntax? Line in file:... (1 Reply)
Discussion started by: graysky
1 Replies

3. Shell Programming and Scripting

AWK-grep from line number to the end of file

Does anyone know how to use awk to act like grep from a particular line number to the end of file? I am using Solaris 10 and I don't have any GNU products installed. Say I want to print all occurrences of red starting at line 3 to the end of file. EXAMPLE FILE: red green red red... (1 Reply)
Discussion started by: thibodc
1 Replies

4. Shell Programming and Scripting

awk Adding a Period at the end of a line

I started venturing in learning the art of using AWK/GAWK and wanted to simply added a period from line #11 to line #28 or to the end of the file if there is data. So for example: 11 Centos.NM 12 dojo1 13 redhat.5.5.32Bit 14 redhat.6.2.64Bit... (5 Replies)
Discussion started by: metallica1973
5 Replies

5. Shell Programming and Scripting

awk one liner to print to end of line

Given: 1,2,whatever,a,940,sot how can i print from one particular field to the end of line? awk -F"," '{print $2 - endofline}' the delimiter just happens to be a comma "," in this case. in other cases, it could be hypens: 1---2---whatever---a---940---sot (4 Replies)
Discussion started by: SkySmart
4 Replies

6. Shell Programming and Scripting

awk - end of line - Help!

I have a textfile which I am parsing with awk. The lines do not have the same number of fields, so sometimes $3 is the last field, sometimes not. When I do a 'printf("%s, %s\n", $2, $3)', if $3 is the last field in the line, when I cat the file the output looks something like this:... (3 Replies)
Discussion started by: dmesserly
3 Replies

7. Shell Programming and Scripting

awk to count start and end keyword in a line

Hello fellow awkers and seders: need to figure out a way to ensure a software deployment has completed by checking its trace file in which I can store the deployment results as follows: echo $testvar ===== Summary - Deploy Result - Start ===== ===== Summary - Deploy Result - End =====... (1 Reply)
Discussion started by: ux4me
1 Replies

8. Shell Programming and Scripting

Add column to end of each line with ´awk´

Hi, I have data with approximately 300 columns. I want to add a column to the end of each column with the value "1". Is there a way that I can do this is ´awk´ without having to specify each individual column. For instance, my data looks like: pvb 1 2 3 4 5 ....... 300 fdh 3 4 5 2 4 ......... (4 Replies)
Discussion started by: owwow14
4 Replies

9. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
SQL::Statement::Function(3)				User Contributed Perl Documentation			       SQL::Statement::Function(3)

NAME
SQL::Statement::Function - abstract base class for all function executing terms SYNOPSIS
# this class doesn't have a common constructor, because all derived classes # have their special requirements DESCRIPTION
SQL::Statement::Function is an abstract base class providing the interface for all function executing terms. INHERITANCE
SQL::Statement::Function ISA SQL::Statement::Term METHODS
DESTROY Destroys the term and undefines the weak reference to the owner as well as the reference to the parameter list. NAME
SQL::Statement::Function::UserFunc - implements executing a perl subroutine SYNOPSIS
# create an user function term with an SQL::Statement object as owner, # specifying the function name, the subroutine name (full qualified) # and the parameters to the subroutine my $term = SQL::Statement::Function::UserFunc->new( $owner, $name, $sub, @params ); # access the result of that operation $term->value( $eval ); DESCRIPTION
SQL::Statement::Function::UserFunc implements a term which returns the result of the specified subroutine. INHERITANCE
SQL::Statement::Function ISA SQL::Statement::Term METHODS
new Instantiates a new "SQL::Statement::Function::UserFunc" instance. value Invokes the given soubroutine with the values of the params and return it's result: my @params = map { $_->value($eval); } @{ $self->{PARAMS} }; return $subpkg->$subname( $self->{OWNER}, @params ); NAME
SQL::Statement::Function::NumericEval - implements numeric evaluation of a term SYNOPSIS
# create an user function term with an SQL::Statement object as owner, # specifying the expression to evaluate and the parameters to the subroutine my $term = SQL::Statement::NumericEval->new( $owner, $expr, @params ); # access the result of that operation $term->value( $eval ); DESCRIPTION
SQL::Statement::Function::NumericEval implements the numeric evaluation of a term. All parameters are expected to be numeric. INHERITANCE
SQL::Statement::Function::NumericEval ISA SQL::Statement::Function ISA SQL::Statement::Term METHODS
new Instantiates a new "SQL::Statement::Function::NumericEval" instance. Takes $owner, $expr and @params as arguments (in specified order). value Returns the result of the evaluated expression. NAME
SQL::Statement::Function::Trim - implements the built-in trim function support SYNOPSIS
# create an trim function term with an SQL::Statement object as owner, # specifying the spec, char and the parameters to the subroutine my $term = SQL::Statement::Trim->new( $owner, $spec, $char, @params ); # access the result of that operation $term->value( $eval ); DESCRIPTION
SQL::Statement::Function::Trim implements string trimming. INHERITANCE
SQL::Statement::Function::Trim ISA SQL::Statement::Function ISA SQL::Statement::Term METHODS
new Instantiates a new "SQL::Statement::Function::Trim" instance. Takes $owner, $spec, $char and @params as arguments (in specified order). Meaning of the parameters: $spec Can be on of 'LEADING', 'TRAILING' 'BOTH'. Trims the leading chars, trailing chars or at both ends, respectively. Defaults to 'BOTH'. $char The character to trim - defaults to ' ' @params Expected to be an array with exact 1 element (more aren't evaluated). value Returns the trimmed value of first parameter argument. NAME
SQL::Statement::Function::SubString - implements the built-in sub-string function support SYNOPSIS
# create an substr function term with an SQL::Statement object as owner, # specifying the start and length of the sub string to extract from the # first element of @params my $term = SQL::Statement::SubString->new( $owner, $start, $length, @params ); # access the result of that operation $term->value( $eval ); DESCRIPTION
SQL::Statement::Function::SubString implements a sub-string extraction term. INHERITANCE
SQL::Statement::Function::SubString ISA SQL::Statement::Function ISA SQL::Statement::Term METHODS
new Instantiates a new "SQL::Statement::Function::SubString" instance. Takes $owner, $start, $length and @params as arguments (in specified order). Meaning of the parameters: $start Specifies the start position to extract the sub-string. This is expected to be a SQL::Statement::Term instance. The first character in a string has the position 1. $length Specifies the length of the extracted sub-string. This is expected to be a SQL::Statement::Term instance. If omitted, everything to the end of the string is returned. @params Expected to be an array with exact 1 element (more aren't evaluated). value Returns the extracted sub-string value from first parameter argument. NAME
SQL::Statement::Function::StrConcat - implements the built-in string concatenation SYNOPSIS
# create an substr function term with an SQL::Statement object as owner # and @params to concatenate my $term = SQL::Statement::StrConcat->new( $owner, @params ); # access the result of that operation $term->value( $eval ); DESCRIPTION
SQL::Statement::Function::StrConcat implements a string concatenation term. INHERITANCE
SQL::Statement::Function::StrConcat ISA SQL::Statement::Function ISA SQL::Statement::Term METHODS
new Instantiates a new "SQL::Statement::Function::StrConcat" instance. value Returns the concatenated string composed of the parameter values. AUTHOR AND COPYRIGHT
Copyright (c) 2009,2010 by Jens Rehsack: rehsackATcpan.org All rights reserved. You may distribute this module under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. perl v5.12.1 2010-05-06 SQL::Statement::Function(3)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy