Sponsored Content
Top Forums Shell Programming and Scripting Sed Awk Cut Grep Combination Help ? Post 302294653 by abbzer0 on Thursday 5th of March 2009 03:22:07 PM
Old 03-05-2009
1. There will be a blank carriage return inbetween the paragraphs.

2. The NAME (in the first one) matches Service (in the second)


Thanks for your quick response.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed, grep, cut or combine?

I am a beginner at shell scripting, actually i am working on my first script right now. Anyway i have searched the world how to grep two letters from each word (it will always just be two words). For example: Example Blablabla I want my script to cut out Ex (from the first word) and Bl... (4 Replies)
Discussion started by: maskot
4 Replies

2. Shell Programming and Scripting

cut sed grep or other?

Hi Is there a way to cut the last two characters off a word or number given that this word or number can be of varying length? I have tried something like TEST=`echo $OLD | cut -c 1-5` where $OLD is a variable containing a number like 1234567 which gives a result of 12345. This is fine... (4 Replies)
Discussion started by: rleebife
4 Replies

3. Shell Programming and Scripting

cut in sed/awk

Hi Can i have an example where i should be able to cut columns (like for eg cut -c 1-3) in sed or awk. Regards Dhana (12 Replies)
Discussion started by: dhanamurthy
12 Replies

4. UNIX for Dummies Questions & Answers

Awk/sed solution for grep,cut

Hi, From the file "example" with lines like below, I need the int value associated with ENG , i.e, 123 SUB: ENG123, GROUP 1 SUB: HIS124, GROUP 1 .. .. Normally , i do grep ENG example | cut -d ' ' -f 2 | cut -c 4-6 Is it possible to do it in simpler way using awk/sed ? ... (5 Replies)
Discussion started by: priyam
5 Replies

5. Shell Programming and Scripting

Using grep and cut within awk

Hi My input file looks like as follows: say a.txt "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss... (5 Replies)
Discussion started by: bittoo
5 Replies

6. Shell Programming and Scripting

Advice using cut & echo combination commands

Hi, I am cutting data from a fixed length test file and then writing out a new record using the echo command, the problem I have is how to stop multiple spaces from being written to the output file as a single space. Example: cat filea | while read line do field1=`echo $line | cut -c1-2` ... (6 Replies)
Discussion started by: dc18
6 Replies

7. Shell Programming and Scripting

GREP/CUT/AWK to Arrays

hi people, I have a text file containing data, seperated by TAB. I want to process this tab'ed data as variable. how can I assign this? Ex: Code: 11aaa 12000 13aaa 14aaa 15aaa 16aaa 17aaa 21aaa 22000 23aaa 24aaa 25aaa 26aaa 27aaa 31aaa 32000 33aaa 34aaa 35aaa 36aaa 37aaa... (1 Reply)
Discussion started by: gc_sw
1 Replies

8. Shell Programming and Scripting

Using a combination of sort/cut/grep/awk/join/paste/sed

I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies

9. UNIX for Dummies Questions & Answers

Print/cut/grep/sed/ date yyyymmdd on the filename only.

I have this filename "RBD_EXTRACT_a3468_d20131118.tar.gz" and I would like print out the "yyyymmdd" only. I use this command below, but if different command like cut or print....etc. Thanks ls RBD_EXTRACT* | sed 's/.*\(........\).tar.gz$/\1/' > test.txt (9 Replies)
Discussion started by: dotran
9 Replies
HTTP::Config(3pm)					User Contributed Perl Documentation					 HTTP::Config(3pm)

NAME
HTTP::Config - Configuration for request and response objects SYNOPSIS
use HTTP::Config; my $c = HTTP::Config->new; $c->add(m_domain => ".example.com", m_scheme => "http", verbose => 1); use HTTP::Request; my $request = HTTP::Request->new(GET => "http://www.example.com"); if (my @m = $c->matching($request)) { print "Yadayada " if $m[0]->{verbose}; } DESCRIPTION
An "HTTP::Config" object is a list of entries that can be matched against request or request/response pairs. Its purpose is to hold configuration data that can be looked up given a request or response object. Each configuration entry is a hash. Some keys specify matching to occur against attributes of request/response objects. Other keys can be used to hold user data. The following methods are provided: $conf = HTTP::Config->new Constructs a new empty "HTTP::Config" object and returns it. $conf->entries Returns the list of entries in the configuration object. In scalar context returns the number of entries. $conf->empty Return true if there are no entries in the configuration object. This is just a shorthand for "not $conf->entries". $conf->add( %matchspec, %other ) $conf->add( \%entry ) Adds a new entry to the configuration. You can either pass separate key/value pairs or a hash reference. $conf->remove( %spec ) Removes (and returns) the entries that have matches for all the key/value pairs in %spec. If %spec is empty this will match all entries; so it will empty the configuation object. $conf->matching( $uri, $request, $response ) $conf->matching( $uri ) $conf->matching( $request ) $conf->matching( $response ) Returns the entries that match the given $uri, $request and $response triplet. If called with a single $request object then the $uri is obtained by calling its 'uri_canonical' method. If called with a single $response object, then the request object is obtained by calling its 'request' method; and then the $uri is obtained as if a single $request was provided. The entries are returned with the most specific matches first. In scalar context returns the most specific match or "undef" in none match. $conf->add_item( $item, %matchspec ) $conf->remove_items( %spec ) $conf->matching_items( $uri, $request, $response ) Wrappers that hides the entries themselves. Matching The following keys on a configuration entry specify matching. For all of these you can provide an array of values instead of a single value. The entry matches if at least one of the values in the array matches. Entries that require match against a response object attribute will never match unless a response object was provided. m_scheme => $scheme Matches if the URI uses the specified scheme; e.g. "http". m_secure => $bool If $bool is TRUE; matches if the URI uses a secure scheme. If $bool is FALSE; matches if the URI does not use a secure scheme. An example of a secure scheme is "https". m_host_port => "$hostname:$port" Matches if the URI's host_port method return the specified value. m_host => $hostname Matches if the URI's host method returns the specified value. m_port => $port Matches if the URI's port method returns the specified value. m_domain => ".$domain" Matches if the URI's host method return a value that within the given domain. The hostname "www.example.com" will for instance match the domain ".com". m_path => $path Matches if the URI's path method returns the specified value. m_path_prefix => $path Matches if the URI's path is the specified path or has the specified path as prefix. m_path_match => $Regexp Matches if the regular expression matches the URI's path. Eg. qr/.html$/. m_method => $method Matches if the request method matches the specified value. Eg. "GET" or "POST". m_code => $digit m_code => $status_code Matches if the response status code matches. If a single digit is specified; matches for all response status codes beginning with that digit. m_proxy => $url Matches if the request is to be sent to the given Proxy server. m_media_type => "*/*" m_media_type => "text/*" m_media_type => "html" m_media_type => "xhtml" m_media_type => "text/html" Matches if the response media type matches. With a value of "html" matches if $response->content_is_html returns TRUE. With a value of "xhtml" matches if $response->content_is_xhtml returns TRUE. m_uri__$method => undef Matches if the URI object provides the method. m_uri__$method => $string Matches if the URI's $method method returns the given value. m_header__$field => $string Matches if either the request or the response have a header $field with the given value. m_response_attr__$key => undef m_response_attr__$key => $string Matches if the response object has that key, or the entry has the given value. SEE ALSO
URI, HTTP::Request, HTTP::Response COPYRIGHT
Copyright 2008, Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-15 HTTP::Config(3pm)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy