Sponsored Content
Full Discussion: API Based URL Parsing
Top Forums Shell Programming and Scripting API Based URL Parsing Post 302860003 by Akshay Hegde on Friday 4th of October 2013 11:38:33 AM
Old 10-04-2013
you may try this awk version

Code:
$ awk -F'[<,>]' 'BEGIN{print "col|col2"}/<col/{i++;printf (i==1)? $3 OFS:  $3 "\n"}{i=(i!=1)?0:i}' OFS="|"  file
col|col2
159.3|17.8111
1.3|1.11

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing url string

Hi, I have a url like this:- http://resource.ibab.ac.in/cgi-bin/pubmed_abstract/y.cgi?pmid=+1.10529272+&pmid=+3.8379586 I want to parse the url string.I want to get the values 1.10529272 3.8379586 How do i do that? (5 Replies)
Discussion started by: vanitham
5 Replies

2. Web Development

Regex to rewrite URL to another URL based on HTTP_HOST?

I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST The call goes out to http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena The ID in the middle is always random due to the cookie. I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies

3. Shell Programming and Scripting

parsing file based on characters/bytes

I have a datafile that is formatted as fixed. I know that each line should contain 880 characters. I want to separate the file into 2 files, one that has lines with 880 characters and the other file with everything else. Is this possible ? (9 Replies)
Discussion started by: cheeko111
9 Replies

4. Shell Programming and Scripting

Using md5sum to name file based on URL

I am trying to download a file and make the filename of the file be the md5sum of the URL. I know to use wgets to download the file but I do not know how to do the rest...any help would be appreciated. (2 Replies)
Discussion started by: The undertaker
2 Replies

5. Shell Programming and Scripting

Need to run an API from a script and extract fields from output of API

Hi, I need to call an API (GetUsageDetails)from inside a shell script which takes an input argument acct_nbr. The output of API will be like : <usageAccum accumId="450" accumCaptn="PM_125" inclUnits="1410.00" inclUnitsUsed="744.00" shared="true" pooled="false" prorated="false"... (1 Reply)
Discussion started by: rkrish
1 Replies

6. Post Here to Contact Site Administrators and Moderators

Page Not Found error while parsing url

Hi I just tried to post following link while answering, its not parsing properly, just try on your browser Tried to paste while answering : https://www.unix.com/302873559-post2.htmlNot operator is not coming with HTML/PHP tags so attaching file (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

7. Web Development

Mod_rewrite - URL rewrite based upon HTTP_REFERER

Hello, I have added following rewrite cond and rewrite rules but it does not work. RewriteCond %{HTTP_REFERER} ^http://192\.168\.1\.150/categories/.*$ RewriteRule ^(.*)$ http://www.blahblah.com/ When I hit url : http://192.168.1.150/categories/881-Goes?page=7 in my browser - it... (2 Replies)
Discussion started by: ashokvpp
2 Replies

8. Shell Programming and Scripting

Parsing a file based on next line

I have a file1 like ID E2AK1_HUMAN Reviewed; 630 AA. CC -!- SUBCELLULAR LOCATION: Host nucleus {ECO:0000305}. ID E1A_ADEM1 Reviewed; 200 AA. ID E1A_ADES7 Reviewed; 266 AA. CC -!- SUBCELLULAR LOCATION: Host nucleus... (8 Replies)
Discussion started by: sammy777
8 Replies

9. Shell Programming and Scripting

Parsing a file based on positional constraints

I have a list file1 like dog cow fox cat fish duck crowI want to classify the elements of file1 based on constrains applied on file2. Additionally the number of elements (words) in the each line of file2 is not fixed. This is my file2 cow cat fox dog cow fox dog fish crow fox dog cat ... (5 Replies)
Discussion started by: sammy777
5 Replies

10. Shell Programming and Scripting

File Parsing based on a character in a specific field

Hi All, I'm having a hard time finding a starting point for my issue. I have a 30k line file (fspsec.txt) that I would like to parse into smaller files based on any character existing in field 1. ACCOUNTANT LEVEL 1 (ACCT.ACCOUNTANT) OPERATORS: DOEJO (418) TOOLS: Branch Maintenance ... (2 Replies)
Discussion started by: aahlrich
2 Replies
Frontier::Client(3)					User Contributed Perl Documentation				       Frontier::Client(3)

NAME
Frontier::Client - issue Frontier XML RPC requests to a server SYNOPSIS
use Frontier::Client; $server = Frontier::Client->new( I<OPTIONS> ); $result = $server->call($method, @args); $boolean = $server->boolean($value); $date_time = $server->date_time($value); $base64 = $server->base64($value); $value = $boolean->value; $value = $date_time->value; $value = $base64->value; DESCRIPTION
Frontier::Client is an XML-RPC client over HTTP. Frontier::Client instances are used to make calls to XML-RPC servers and as shortcuts for creating XML-RPC special data types. METHODS
new( OPTIONS ) Returns a new instance of Frontier::Client and associates it with an XML-RPC server at a URL. OPTIONS may be a list of key, value pairs or a hash containing the following parameters: url The URL of the server. This parameter is required. For example: $server = Frontier::Client->new( 'url' => 'http://betty.userland.com/RPC2' ); proxy A URL of a proxy to forward XML-RPC calls through. encoding The XML encoding to be specified in the XML declaration of outgoing RPC requests. Incoming results may have a different encoding specified; XML::Parser will convert incoming data to UTF-8. The default outgoing encoding is none, which uses XML 1.0's default of UTF-8. For example: $server = Frontier::Client->new( 'url' => 'http://betty.userland.com/RPC2', 'encoding' => 'ISO-8859-1' ); use_objects If set to a non-zero value will convert incoming <i4>, <float>, and <string> values to objects instead of scalars. See int(), float(), and string() below for more details. debug If set to a non-zero value will print the encoded XML request and the XML response received. call($method, @args) Forward a procedure call to the server, either returning the value returned by the procedure or failing with exception. `$method' is the name of the server method, and `@args' is a list of arguments to pass. Arguments may be Perl hashes, arrays, scalar values, or the XML-RPC special data types below. boolean( $value ) date_time( $value ) base64( $base64 ) The methods `"boolean()"', `"date_time()"', and `"base64()"' create and return XML-RPC-specific datatypes that can be passed to `"call()"'. Results from servers may also contain these datatypes. The corresponding package names (for use with `"ref()"', for exam- ple) are `"Frontier::RPC2::Boolean"', `"Frontier::RPC2::DateTime::ISO8601"', and `"Frontier::RPC2::Base64"'. The value of boolean, date/time, and base64 data can be set or returned using the `"value()"' method. For example: # To set a value: $a_boolean->value(1); # To retrieve a value $base64 = $base64_xml_rpc_data->value(); Note: `"base64()"' does not encode or decode base64 data for you, you must use MIME::Base64 or similar module for that. int( 42 ); float( 3.14159 ); string( "Foo" ); By default, you may pass ordinary Perl values (scalars) to be encoded. RPC2 automatically converts them to XML-RPC types if they look like an integer, float, or as a string. This assumption causes problems when you want to pass a string that looks like "0096", RPC2 will convert that to an <i4> because it looks like an integer. With these methods, you could now create a string object like this: $part_num = $server->string("0096"); and be confident that it will be passed as an XML-RPC string. You can change and retrieve values from objects using value() as described above. SEE ALSO
perl(1), Frontier::RPC2(3) <http://www.scripting.com/frontier5/xml/code/rpc.html> AUTHOR
Ken MacLeod <ken@bitsko.slc.ut.us> perl v5.8.0 2003-01-27 Frontier::Client(3)
All times are GMT -4. The time now is 08:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy