Sponsored Content
Full Discussion: Search and replace (perl)
Top Forums Shell Programming and Scripting Search and replace (perl) Post 302855317 by dragonpoint on Thursday 19th of September 2013 02:58:53 PM
Old 09-19-2013
Search and replace (perl)

How can I achieve this? Perl would be awesome.

Input string a_b c[10_9] //Note there is a blank here
Needed Output a_b_c[10:9]

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl search and replace pairs

Hello all im facing some kind of problem i have this string : functionA() $" "$ functionB("arg1") $" = "$ i will like to replace all the pairs of opening and closing "$" to be something like that functionA() <#" "#> functionB("arg1") <#" = "#> i cant of course do is with simple ... (1 Reply)
Discussion started by: umen
1 Replies

2. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

3. Shell Programming and Scripting

Search and replace in Perl

Hello, I have a Perl script that reads in an Excel spread sheet and formats the values into a text file. I am having trouble with one column that can have numbers or letters. Excel left justifies the values that start with a letter and right justifies the values that contain only a... (2 Replies)
Discussion started by: jyoung
2 Replies

4. Shell Programming and Scripting

Perl: Global Search and replace

I have a file where the rows correspond to individuals and the columns are about 106 variables. Each variable is coded as either ACGT, and "missing" is coded as blank. This is a tab delimited file. I'm trying to replace all blanks (" ") with 0. The simple script I have is only replacing some of the... (3 Replies)
Discussion started by: epi8
3 Replies

5. Shell Programming and Scripting

Perl search and replace in range using variable

Hi. I have a file with asterisk field separators and backslash line terminators. The first field in each line names the line type. I am trying to process each range separately. Here's what the data looks like: BA*DATA\ LS*DATA1*DATA2*00020*\ TA*DATA1*DATA2*DATA3*\ TA*DATA1*DATA2*DATA3*\... (1 Reply)
Discussion started by: yoi2hot4ya
1 Replies

6. Shell Programming and Scripting

Perl search and replace file content.

I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is giving me the number count instead of the actual lines with changes. open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
Discussion started by: jxh461
3 Replies

7. Shell Programming and Scripting

Search and Replace in Perl

I am trying to write a simple perl script to run on a FreeBSD machine. There are alot of posts here, and I have read so many, yet can not get this script to run. #!/usr/bin/perl -e 's/\r\n/~/' infile.txt outfile.txt I am trying to take a windows text file, move it into Unix, run a script on... (1 Reply)
Discussion started by: mach1
1 Replies

8. Shell Programming and Scripting

Perl - search and replace a particular field

Hi, I have a file having around 30 records. Each record has 5 fields delimited by PIPE. Few records in the file having Junk characters in the field2 and field4. I found the junk charcter and I tested it and replace the junk with space with the command below perl -i -p -e "s/\x00/ /g"... (1 Reply)
Discussion started by: ramkrix
1 Replies

9. Shell Programming and Scripting

perl: search replace in multiple files

When I use special characters the command to replace multiple files with a string pattern does nt work. ---------- Post updated at 12:33 PM ---------- Previous update was at 11:38 AM ---------- This works perl -pi -e 's/100/test/g' * This does nt work perl -pi -e 's... (1 Reply)
Discussion started by: w020637
1 Replies

10. UNIX for Advanced & Expert Users

Search and replace a line in perl

Hi All, i can replace a perticular value in sentence using perl. perl -pi -e 's/old/new/' sample.txt but i am not able to replace whole string by perl. file1 contains "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.147.109.211)(PORT=1526))(CONNECT_DATA=(SID= MWDBD22)))". i... (3 Replies)
Discussion started by: arindam guha
3 Replies
DECLAR(3)							 GENPAT functions							 DECLAR(3)

NAME
DECLAR, GENPAT Package ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
DECLAR("ident",":nb_space","format",mode,size,option); PARAMETERS
ident External connector, internal observing points or register's name. For the hierarchical descriptions, the path-name of the inter- nal observing points or registers must be specified by the syntax : instance1.instance11.name . nb_space Specify the number of blank space between each group of value associated to the connectors, signals or registers in the output file. 0,1,2,3,4,5,6,7,8,9 or nothing. format Specify the format that will be used to represent the value associated to the connectors, signals or registers. X for Hexadeci- mal, O for Octal and B for Binary. mode Specify the type of the connectors. IN for Input, OUT for Output, INOUT for Input/Output, SIGNAL for internal observing point, REGISTER for register. IN, OUT, INOUT, SIGNAL, REGISTER are constants (defines) provided by genpat. size Specify the size of the bused connectors : empty ("") for the scalar connectors, "nb1" for the numbered connectors, "nb1 TO nb2" or "(nb1 TO nb2)" (nb1 < nb2), "nb1 DOWNTO nb2" or "(nb1 DOWNTO nb2)" (nb2 < nb1) for the vectors. Where nb1 and nb2 are integer. option Specify options of the connector. "S" for a spied connector, empty ("") for a normal connector. DESCRIPTION
Describes a set of connectors, signals or registers of the same format, size and mode. EXAMPLE
DECLAR("a", ":2", "X", OUT, "3 DOWNTO 0", "S"); describes : a 3, a 2, a 1, a 0 format : Hexadecimal. mode : Output. option : Spied connector. the group is separated of the others with 2 blank spaces. result : out a(3 downto 0) X spy ;;; DECLAR ("toto", ":", "O", INOUT, "7 TO 11", ""); describes : toto 7, toto 8, toto 9, toto 10, toto 11. format : Octal. mode : Input/Output. option : none. the group is separated of the following with 0 blank space. result : inout toto(7 to 11) O ; DECLAR ("ck", ":2", "B", IN, "", ""); describes : ck. format : Binary. mode : Input. option : none. the port is separated of the following with 2 blank spaces. result : in ck ;;; DECLAR ("accu.f", ":", "B", SIGNAL, "", "S"); describes : accu.f . format : Binary. mode : Signal. option : Spied connector. the signal is separated of the following with 0 blank space. result : signal accu.f spy ; DECLAR ("accu.reg", ":1", "B", REGISTER, "(3)", ""); describes : accu.reg . format : Binary. mode : Register. option : none. the signal is separated of the following with 1 blank space. result : register accu.reg(3) ;;;; WARNING
The DECLAR function from the 4.0 release have a new parameter (option). SEE ALSO
ARRAY(3), genpat(1), pat(5) BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 DECLAR(3)
All times are GMT -4. The time now is 05:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy