Sponsored Content
Full Discussion: parsing url string
Top Forums Shell Programming and Scripting parsing url string Post 302141494 by radoulov on Friday 19th of October 2007 09:41:16 AM
Old 10-19-2007
Code:
$ s="http://resource.ibab.ac.in/cgi-bin/pubmed_abstract/y.cgi?pmid=+1.10529272+&pmid=+3.8379586"
$ (IFS=+;set -- $(printf "%s" "$s"|cut -d+ -f2,4);printf "%s %s\n" "$1" "$2")
1.10529272 3.8379586

With GNU cut:
Code:
% s="http://resource.ibab.ac.in/cgi-bin/pubmed_abstract/y.cgi?pmid=+1.10529272+&pmid=+3.8379586"
% printf "%s" "$s"|cut -d+ -f2,4 --output-delimiter=" "
1.10529272 3.8379586

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

2. Shell Programming and Scripting

pattern match url in string / PERL

Am trying to remove urls from text strings in PERL. I have the following but it does not seem to work: $remarks =~ s/www\.\s+\.com//gi; In English, I want to look for www. then I want to delete the www. and everything after it until I hit a space (but not including the space). It's not... (2 Replies)
Discussion started by: mrealty
2 Replies

3. Shell Programming and Scripting

Splitting URL request string including escape characters

Hi All, I have a text file containing two fields, the first field holds the website name and the second one holds the rest of the URL (Request part). My requirement is to split the request part based on the characters "=" and "&". The process should also consider the URL escape characters, for... (4 Replies)
Discussion started by: john2022
4 Replies

4. Shell Programming and Scripting

Parsing a long string string problem for procmail

Hi everyone, I am working on fetchmail + procmail to filter mails and I am having problem with parsing a long line in the body of the email. Could anyone help me construct a reg exp for this string below. It needs to match exactly as this string. GetRyt... (4 Replies)
Discussion started by: cwiggler
4 Replies

5. UNIX for Dummies Questions & Answers

Awk: print all URL addresses between iframe tags without repeating an already printed URL

Here is what I have so far: find . -name "*php*" -or -name "*htm*" | xargs grep -i iframe | awk -F'"' '/<iframe*/{gsub(/.\*iframe>/,"\"");print $2}' Here is an example content of a PHP or HTM(HTML) file: <iframe src="http://ADDRESS_1/?click=5BBB08\" width=1 height=1... (18 Replies)
Discussion started by: striker4o
18 Replies

6. Shell Programming and Scripting

API Based URL Parsing

Hi Friends, We have a situation where we need to pass API based URL which will return XML response ,and I need to convert those XML response to a delimited flat file. url.txt -- will have http://xyz.com/beta/xxx.xml?isDRR=True&city=London&province=England... (1 Reply)
Discussion started by: rakesh5300
1 Replies

7. Web Development

Append query string via URL rewrite in apache

Hi, Googled around but I couldn't find anything similar. I'm looking to do the following in apache.. if a user comes into the following URL. http://www.example.com/some/thing.cid?wholebunch_of_stuff_here keep the URL exactly as is BUT add &something at the very end of it. thanks in... (1 Reply)
Discussion started by: kmaq7621
1 Replies

8. 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

9. Shell Programming and Scripting

Reading URL using Mechanize and dump all the contents of the URL to a file

Hello, Am very new to perl , please help me here !! I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file. below is the script which i have written so far , #!/usr/bin/perl use LWP::UserAgent; use... (2 Replies)
Discussion started by: scott_cog
2 Replies

10. Shell Programming and Scripting

Url encoding a string using sed

Hi I was hoping some one would know if it is possible to url encode a string using sed? My problem is I have extracted some key value pairs from a text file with sed, and will be inserting these pairs as source variables into a curl script to automatically download some xml from our server. My... (5 Replies)
Discussion started by: Paul Walker
5 Replies
cgi_url_escape_more(3)						     cgi/cgi.h						    cgi_url_escape_more(3)

NAME
cgi_url_escape_more - url escape a string SYNOPSIS
#include <cgi/cgi.h> NEOERR *cgi_url_escape_more (const char *buf, char **esc, const char *other); ARGUMENTS
buf - a 0 terminated string other - a 0 terminated string of characters to escape DESCRIPTION
cgi_url_escape_more will do URL escaping on the passed in string, and return a newly allocated string that is escaped. Characters which are escaped include control characters, %, ?, +, space, =, &, /, and " and any characters in other RETURN VALUE
esc - a newly allocated string SEE ALSO
cgi_debug_init(3), cgi_parse(3), cgi_destroy(3), cgi_js_escape(3), cgi_html_escape_strfunc(3), cgi_register_strfuncs(3), cgi_output(3), parse_rfc2388(3), cgi_url_validate(3), open_upload(3), cgi_cs_init(3), cgi_url_escape_more(3), cgi_html_strip_strfunc(3), cgi_neo_error(3), cgi_redirect(3), cgi_filehandle(3), cgi_register_parse_cb(3), cgi_url_escape(3), cgi_init(3), cgi_redirect_uri(3), cgi_cookie_clear(3), cgi_url_unescape(3), cgi_vredirect(3), cgi_display(3), cgi_html_ws_strip(3), cgi_error(3), cgi_cookie_set(3), cgi_text_html_strfunc(3), cgi_cookie_authority ClearSilver 12 July 2007 cgi_url_escape_more(3)
All times are GMT -4. The time now is 10:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy