Sponsored Content
Top Forums Shell Programming and Scripting find and Replace String in Perl - Regexp Post 302959300 by MadeInGermany on Saturday 31st of October 2015 08:14:01 AM
Old 10-31-2015
$repl_str contains a / that is also used as a separator.
Take another separator
's#$find_str#$repl_str#'
--
Why do you run another perl instance?
This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find the position of a string and replace with another string

Hi, I have a file named "Test_2008_01_21" The file contains a string "manual" that occurs many times in the file How can i find the positions of the string "manual" in the file Ex: if the string " manual " occurs three times in the file. i want to replace the second occurance of string... (6 Replies)
Discussion started by: bab123
6 Replies

2. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

3. Shell Programming and Scripting

How to replace string in perl?

Hi, I have string like this: $query="#1,apple"; $string=$query; I want to replace #1 with fruit. I tried like this: string=~s/#\d+/$query/ig; print "\n string: $string\n"; It is working only when there is single #1 or #2 but when i give like #1,#2,#3,apple the above code... (2 Replies)
Discussion started by: vanitham
2 Replies

4. Shell Programming and Scripting

How to find the count and replace the particular part of string in perl?

Hi, I am taking the current time using localtime function in perl. For example if the time is: #Using localtime $time = "12:3:10"; I have to replace the value 3 (03) i.e second position to be 03. The output should be: 12:03:10 But if the other string for example: $str:... (1 Reply)
Discussion started by: vanitham
1 Replies

5. Shell Programming and Scripting

replace awk with a perl one liner (REGEXP and FS)

hello, I want to replace awk with a perl one liner in unix. i use in awk REGEX and FS ( field separator) because awk syntaxes in different unix os versions have not the same behaviour. Awk, Nawk and GNU Awk Cheat Sheet - good coders code, great reuse i have a file named "file" and want... (5 Replies)
Discussion started by: bora99
5 Replies

6. Shell Programming and Scripting

find string and replace with string in other file

Dear all, I need your help, I have file like this: file1:23456 01910964830098775635 34567 01942809546554654323 67589 26546854368698023653 09778 58716868568576876878 08675 86178546154065406546 08573 54165843543054354305 . .file2: 23456 25 34567 26 67589 27 (2 Replies)
Discussion started by: attila
2 Replies

7. Shell Programming and Scripting

HPUX find string in directory and filetype and replace string

Hi, Here's my dilemma. I need to replace the string Sept_2012 to Oct_2012 in all *config.py files within the current directory and below directories Is this possible? Also I am trying to find all instances of the string Sept_2012 within files in the current directory and below I have... (13 Replies)
Discussion started by: pure_jax
13 Replies

8. Solaris

How to find and replace a string?

Dear All I need to find and replace a string in a set of files. I try as : #find / -name "*"|xargs grep "Tektra"|grep -v "Tektra GSM BTS" But it doesn't work. It just finds the string in the files. I need to find and replace it.Can you please let me know how to correct it? Thank you (2 Replies)
Discussion started by: hadimotamedi
2 Replies

9. Shell Programming and Scripting

How to use regexp to find an ipaddress from a query string?

I need help with a regexp to find out the ip address which can possibly be present in a URL. The URLs can be in any of the following form <domain>?a=12345&d=somestring1 <domain>?c=10.10.10.100&d=somestring1 <domain>?a=12345&b=somestring1&c=10.1.2.4d=somestring2... (3 Replies)
Discussion started by: ampak
3 Replies

10. Shell Programming and Scripting

Perl script to read string from file#1 and find/replace in file#2

Hello Forum. I have a file called abc.sed with the following commands; s/1/one/g s/2/two/g ... I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat sed -f abc.sed abc.dat >... (10 Replies)
Discussion started by: pchang
10 Replies
DwtSeparatorGadgetCreate(3Dwt)											    DwtSeparatorGadgetCreate(3Dwt)

Name
       DwtSeparatorGadgetCreate - Creates a separator gadget.

Syntax
       Widget DwtSeparatorGadgetCreate (parent_widget, name,
					override_arglist,
					override_argcount)
	    Widget parent_widget;
	    char *name;
	    ArgList override_arglist;
	    int override_argcount;

Arguments
       parent_widget
		 Specifies the parent widget ID.

       name	 Specifies the name of the created widget.

       override_arglist
		 Specifies the application override argument list.

       override_argcount
		 Specifies the number of attributes in the application override argument list (override_arglist).

Description
       The DwtSeparatorGadgetCreate function creates an instance of the separator gadget and returns its associated gadget ID.	A separator gadget
       is similar in appearance and semantics to a separator widget.  Like all gadgets, DwtSeparatorGadgetCreate does not have a window  but  uses
       the  window  of	the closest antecedent widget.	Thus, the antecedent widget provides all event dispatching for the gadget.  This currently
       restricts gadgets to being descendents of menu or dialog class (or subclass) widgets.

Inherited Attributes
       ----------------------------------------------------
       Attribute Name	       Data Type   Default
       ----------------------------------------------------
       Rectangle Attributes
       DwtNx		       Position    Determined	by
					   the	  geometry
					   manager
       DwtNy		       Position    Determined	by
					   the	  geometry
					   manager
       DwtNwidth	       Dimension   3 pixels
       DwtNheight	       Dimension   3 pixels
       DwtNborderWidth	       Dimension   zero
       DwtNsensitive	       Boolean	   True
       DwtNancestorSensitive   Boolean	   The bitwise AND
					   of  the  parent
					   widget's
					   DwtNsensitive
					   and	DwtNances-
					   torSensitive
					   attributes
       ----------------------------------------------------

Widget-Specific Attributes
       ------------------------------------------------------------
       Attribute Name	 Data Type	 Default
       ------------------------------------------------------------
       DwtNorientation	 unsigned char	 DwtOrientationHorizontal
       ------------------------------------------------------------

       DwtNorientation
		      Specifies whether the separator is displayed vertically or horizontally.	You can pass DwtOrientationHorizontal or DwtOrien-
		      tationVertical.  A separator gadget draws a centered single pixel line between the appropriate margins.  For example, a hor-
		      izontal separator draws a horizontal line from the left margin to the right margin.  It is placed vertically in  the  middle
		      of the gadget.

Return Values
       This function returns the ID of the created widget.

Callback Information
       There is no callback for this gadget.

See Also
       Guide to the XUI Toolkit: C Language Binding
       Guide to the XUI Toolkit Intrinsics: C Language Binding

														    DwtSeparatorGadgetCreate(3Dwt)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy