Sponsored Content
Top Forums Shell Programming and Scripting Single parse to grab two chunks of string Post 302976482 by 3sparky on Wednesday 29th of June 2016 04:38:33 PM
Old 06-29-2016
thats done it - thats cracking thanky guys
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String parse question

I have a string of data that looks like this: private.enterprises.954.1.1.1.1.1.2618 \(OctetString\): U private.enterprises.954.1.1.1.1.2.2618 \(OctetString\): 2618 I am trying to parse the string to only return the values after the ":". Ex from above "U" and "2618". Any suggestions? (5 Replies)
Discussion started by: mnreferee
5 Replies

2. Shell Programming and Scripting

how to parse this string

I want to get filenames from the following input. How can I parse this in bash. input data ------------------------------------------------------------------- path=/aaa/bbb/filename1;/aaa/filename2;/aaa/bbb/ccc/ddd/filename3 -------------------------------------------------------------------... (13 Replies)
Discussion started by: hcliff
13 Replies

3. Shell Programming and Scripting

Parse string

Hi, I need to parse a string, check if there are periods and strip the string. For example i have the following domains and subdomains: mydomain.com, dev.mydomain.com I need to strip all periods so i have a string without periods or domain extensions: mydomain, devmydomain. I use this for... (12 Replies)
Discussion started by: ktm
12 Replies

4. Shell Programming and Scripting

Grab first or second line after a search string

In a shell script, I need to grab the first or second line after a search string in a file. For example: File.out: Random Info Manufacturer: XYZPDQ System Info Manufacturer: Hewlett-Packard Product Name: ProLiant I search for the word FILE, I want to be able to grab the line... (1 Reply)
Discussion started by: jwk1230
1 Replies

5. Shell Programming and Scripting

Parse a single line file and store value.

I have a single line file like this : Average Fragmentation Quotient : 3.084121 Now I want to store the value which comes after ":" i,e 3.084121 into a variable. And if this variable crosses above 6 i want to call another script... can any one help me on this... (7 Replies)
Discussion started by: Hyp_Todd
7 Replies

6. Shell Programming and Scripting

parse a mixed alphanumeric string from within a string

Hi, I would like to be able to parse out a substring matching a basic pattern, which is a character followed by 3 or 4 digits (for example S1234 out of a larger string). The main string would just be a filename, like Thisis__the FileName_S1234_ToParse.txt. The filename isn't fixed, but the... (2 Replies)
Discussion started by: keaneMB
2 Replies

7. Shell Programming and Scripting

Replace string, grab files, rename and move

Hello there! I'm having a lot of trouble writing a script. The script is supposed to: 1) Find all files with the name "Object.mtl" within each folder in the directory: /Users/username/Desktop/convert/Objects 2) Search and replace the string ".bmp" with ".tif" (without the quotations) 3)... (1 Reply)
Discussion started by: Blue Solo
1 Replies

8. Homework & Coursework Questions

How to use xargs to repeat as a loop to grab date string?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: My goal to find how many requests in 14 days from weblog server. I know to cat a weblog file to wc -l to find the... (8 Replies)
Discussion started by: scopiop
8 Replies

9. Shell Programming and Scripting

Need to parse the multiple definitions from a single line and assign

Hi, I need a help on my requirement that eg: NEED="TEST=Name WORK=Ps DEL=let" Here the definition can be n number, could anybody have an idea to get the output as, TEST=Name WORK=Ps DEL=let .. .. till the 'n' definitions listed. Any suggestions please..... Regards, ricky (6 Replies)
Discussion started by: ricky-row
6 Replies

10. Shell Programming and Scripting

Parse for 2 numbers in large single line

Hi All, I am writing a script in which I need to gather 2 numbers for 'total' and 'successful'. The goal is to compare the two numbers and if they are not equal, rerun the task until all are successful. I'm thinking the best way will be with awk or sed, but I really don't know where to begin... (8 Replies)
Discussion started by: hburnswell
8 Replies
Mojo::Content::Single(3pm)				User Contributed Perl Documentation				Mojo::Content::Single(3pm)

NAME
Mojo::Content::Single - HTTP 1.1 content container SYNOPSIS
use Mojo::Content::Single; my $single = Mojo::Content::Single->new; $single->parse("Content-Length: 12 Hello World!"); DESCRIPTION
Mojo::Content::Single is a container for HTTP 1.1 content as described in RFC 2616. EVENTS
Mojo::Content::Single inherits all events from Mojo::Content and can emit the following new ones. "upgrade" $single->on(upgrade => sub { my ($single, $multi) = @_; ... }); Emitted when content gets upgraded to a Mojo::Content::MultiPart object. $single->on(upgrade => sub { my ($single, $multi) = @_; return unless $multi->headers->content_type =~ /multipart/([^;]+)/i; say "Multipart: $1"; }); ATTRIBUTES
Mojo::Content::Single inherits all attributes from Mojo::Content and implements the following new ones. "asset" my $asset = $single->asset; $single = $single->asset(Mojo::Asset::Memory->new); The actual content, defaults to a Mojo::Asset::Memory object with "auto_upgrade" enabled. "auto_upgrade" my $upgrade = $single->auto_upgrade; $single = $single->auto_upgrade(0); Try to detect multipart content and automatically upgrade to a Mojo::Content::MultiPart object, defaults to 1. METHODS
Mojo::Content::Single inherits all methods from Mojo::Content and implements the following new ones. "new" my $single = Mojo::Content::Single->new; Construct a new Mojo::Content::Single object and subscribe to "read" event with default content parser. "body_contains" my $success = $single->body_contains('1234567'); Check if content contains a specific string. "body_size" my $size = $single->body_size; Content size in bytes. "clone" my $clone = $single->clone; Clone content if possible, otherwise return "undef". "get_body_chunk" my $chunk = $single->get_body_chunk(0); Get a chunk of content starting from a specfic position. "parse" $single = $single->parse("Content-Length: 12 Hello World!"); my $multi = $single->parse("Content-Type: multipart/form-data "); Parse content chunk and upgrade to Mojo::Content::MultiPart object if possible. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Content::Single(3pm)
All times are GMT -4. The time now is 09:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy