Sponsored Content
Full Discussion: Search and assign using sed
Top Forums Shell Programming and Scripting Search and assign using sed Post 302456268 by pattu on Thursday 23rd of September 2010 07:32:22 PM
Old 09-23-2010
Quote:
Originally Posted by jpradley
Use the right tool, which in your case is awk, not sed.
Thanks, How do I do that using awk?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search file for word, then assign to variable

Hi all, Trying to search a file for one word only, then assign that word to a variable. Not sure if this is a grep or awk (or either) function. Should be a simple operation. Example: This file contains the string "COMPLETE". I would like to pull that word out and assign it to a... (2 Replies)
Discussion started by: dejit
2 Replies

2. Shell Programming and Scripting

assign subst|grep|sed command result to a variable

Hi, I'm quite new to scripting and I want to modify following line of an existing script: MYVAR=`subst |grep 'L:\\\:' | sed -e 's/.*\\\//'`; What I have to do is to use the content of a variable instead of the constant expression 'L:\\\:' as the grep string to be matched. Assuming I already... (5 Replies)
Discussion started by: snowbiker99
5 Replies

3. Shell Programming and Scripting

How to assign value to a variable with row(using -n) returned by sed

Hi Friends, REQUIREMENT: Want to delete files from the current directory match with the same in the file test.txt set -x i=1 echo "i=$i" COUNT=`sed -n '$=' test.txt` echo "Count=$COUNT" while do "## Here is error##" FILETOREMOVE=`sed -n \'$i,1p\' test.txt` echo $FILETOREMOVE... (5 Replies)
Discussion started by: sourabhsharma
5 Replies

4. UNIX for Dummies Questions & Answers

SED: Can't Repeat Search Character in SED Output

I'm not sure if the problem I'm seeing is an artifact of sed or simply a beginner's mistake. Here's the problem: I want to add a zero-width space following each underscore between XML tags. For example, if I had the following xml: <MY_BIG_TAG>This_is_a_test</MY_BIG_TAG> It should look like... (8 Replies)
Discussion started by: rhetoric101
8 Replies

5. Shell Programming and Scripting

How to assign the Pattern Search string as Input Variable

guys, I need to know how to assing pattern matched string as an input command variable. Here it goes' My script is something like this. ./routing.sh <Server> <enable|disable> ## This Script takes an input <Server> variable from this line of the script ## echo $1 | egrep... (1 Reply)
Discussion started by: raghunsi
1 Replies

6. Shell Programming and Scripting

sed help - search/copy from one file and search/paste to another

I am a newbie and would like some help with the following - Trying to search fileA for a string similar to - AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3 I then want to replace that string with a string from fileB - ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies

7. Shell Programming and Scripting

Running a program multiple times to search pattern and assign structure

Hi all, I have a big file (n.txt) with following pattern: ATOM 1 N SER A 1 122.392 152.261 138.190 1.00 0.00 N ATOM 2 CA SER A 1 122.726 151.241 139.183 1.00 0.00 C TER ENDMDL ATOM 1 N SER A 1 114.207 142.287 135.439 1.00 0.00 ... (3 Replies)
Discussion started by: bioinfo
3 Replies

8. Shell Programming and Scripting

Trim sed output & assign to variable

Hi, I have the following command that parses an xml file to read a node <port>'s value. Hoever the output comes with spaces. My requirement is to trim the spaces around the value and assign to a variable. sed -n 's|<port>\(.*\)</port>|\1|p' ../cfg.xml How do I go about it? (6 Replies)
Discussion started by: sai2013
6 Replies

9. Shell Programming and Scripting

Regex in sed to find specific pattern and assign to variable

(5 Replies)
Discussion started by: radioactive9
5 Replies

10. UNIX for Beginners Questions & Answers

sed search

Hello, I know how to use sed for simple search but i need to search something like below in a file. From the below string, i need to find and replace only ./ with a $ using sed. ./abcd/str.xyz Thanks in advance KK (8 Replies)
Discussion started by: Pavan Kumar19
8 Replies
WWW::Search::AltaVista::Careers(3pm)			User Contributed Perl Documentation		      WWW::Search::AltaVista::Careers(3pm)

NAME
WWW::Search::AltaVista::Careers - class for searching www.altavistacareers.com SYNOPSIS
use WWW::Search; my $oSearch = new WWW::Search('AltaVista::Careers'); my $sQuery = WWW::Search::escape_query("java c++)"); $oSearch->native_query($sQuery, {'state' => 'CA'}); while (my $res = $oSearch->next_result()) { print $res->title . " " . $res->change_date . " " . $res->location . " " . $res->url . " "; } DESCRIPTION
This class is a AltaVistaCareers specialization of WWW::Search. It handles making and interpreting AltaVistaCareers searches http://careers.altavista.com. The returned WWW::SearchResult objects contain url, title, location and change_date fields. OPTIONS
The following search options can be activated by sending a hash as the second argument to native_query(). The only available options are to select a specific location. The default is to search all locations. To change it use {'state' => $state} - Only jobs in state $state. {'city' => $city} - Only job in a specific $city AUTHOR
"WWW::Search::AltaVistaCareers" is written and maintained by Alexander Tkatchev (Alexander.Tkatchev@cern.ch). LEGALESE
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. native_setup_search This private method does the heavy lifting after native_query() is called. native_retrieve_some This private method does the heavy lifting of communicating with the server. perl v5.12.4 2011-11-02 WWW::Search::AltaVista::Careers(3pm)
All times are GMT -4. The time now is 11:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy