Sponsored Content
Top Forums Programming Perl: How to read from a file, do regular expression and then replace the found regular expression Post 302579393 by durden_tyler on Monday 5th of December 2011 03:10:27 PM
Old 12-05-2011
Can you put your code within code tags?

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular expression help in perl

Hi all, I am trying to match a multi line string and return the matching string in one line. Here is the perl code that I wrote: #!/usr/bin/perl my $str='<title>My title</title>'; if ($str =~ /(<title>)(+)(<\/title>)/ ){ print "$2\n"; } It returns : My title I want the... (3 Replies)
Discussion started by: sdubey
3 Replies

2. UNIX for Dummies Questions & Answers

Regular Expression - Replace if x contains y except if...

Hi all, I have a file which contains 1000s of lines of text. I need to delete all lines with the words "Red" EXCEPT if the line also contains the word "GREEN"... For example: ThisIs some random text that should be red deleted ThisIs some random text that should NOT be red deleted green ... (4 Replies)
Discussion started by: not4google
4 Replies

3. Shell Programming and Scripting

regular expression in perl

hi, i want to extract the sessionID from this line. QnA Session Id : here the output should be-- QnA_SessionID=128589 Thanks NT (3 Replies)
Discussion started by: namishtiwari
3 Replies

4. Shell Programming and Scripting

PERL regular expression

Hello all, I need to match the red expressions in the following lines : MACRO_P+P-_scrambledServices_REM_PRC30.xml MACRO_P+P-_scrambledServices_REM_RS636.xml MACRO_P+P-_scrambledServices_REM_RS535.xml and so on... Can anyone give me a PERL regular expression to match those characters ? ... (5 Replies)
Discussion started by: lsaas
5 Replies

5. Shell Programming and Scripting

Perl Regular Expression

Hello, I am trying to use perl LWP module to read and get a specfic URL page. The issue is that the URL ends with the data and time and time is not consistent it changes all the time. if anyone could help me how to write a regular expressin that would work in the LWP::UserAgent get function to... (0 Replies)
Discussion started by: bataf
0 Replies

6. Shell Programming and Scripting

How to continue numbering after a regular expression has been found

Hello, I have a file starting with: fixedStep chrom=chrX start=1 step=1 0.930 0.955 0.972 0.985 0.993 0.995 0.994 0.990 0.984 0.971 0.942 0.944 0.971 fixedStep chrom=chrX start=200 step=1 0.987 (2 Replies)
Discussion started by: jpoldot
2 Replies

7. Shell Programming and Scripting

Perl regular expression help!

Hi I am doing something basic like... if ($stringvariable =~ /have not typed/) I have a little problem because the 'not' in the expression gets highlighted as a kind of a '!'..what am I supposed to do in this situation? Thank you ---------- Post updated at 03:24 PM ----------... (1 Reply)
Discussion started by: vas28r13
1 Replies

8. Shell Programming and Scripting

Would like to print 3 lines after a regular expression is found in the logfile

I would like to print 3 lines after a regular expression is found in the logfile. I'm using the following code: grep -n "$reg_exp" file.txt |while read LINE ;do i=$(echo $LINE |cut -d':' -f1 ) ;sed -n "$i,$(($i+3))p" file.txt ;done The above code things works fine,but sometimes gives erroneous... (3 Replies)
Discussion started by: joachimshaun
3 Replies

9. Shell Programming and Scripting

Perl regular expression

Hi , I have the below array my @actionText = ("delivered to governor on 21/23/3345" , "deliver jllj" , "ram 2345/43"); When i am trying to grep the contents of array and if mathced substituting with the digitis or some date format from the element like below my @action = grep { $_ =~... (7 Replies)
Discussion started by: ragilla
7 Replies

10. Shell Programming and Scripting

perl : regular expression to replace the strings

There are 2 strings as below. $str1 = "41148,,,,,,,,,,,,,,,,,,,,,,,,"; $date = "TUE 08-28-2012"; The output should be as below $str1 = "TUE 08-28-2012,,,,,,,,,,,,,,,,,,,,,,,,"; Could anyone please help with the perl regular expression or any other alternative? (3 Replies)
Discussion started by: giridhar276
3 Replies
LINTIAN-INFO(1) 					User Contributed Perl Documentation					   LINTIAN-INFO(1)

NAME
       lintian-info - give detailed information about Lintian's error tags

SYNOPSIS
       lintian-info [log-file...]

       lintian-info --tags tag ...

DESCRIPTION
       The lintian-info command parses the output of the lintian command and gives verbose information about the listed Lintian error tags, parses
       a Lintian override file and gives verbose information about the tags included, or (if given the -t or --tags option) explains a given tag
       or tags.

       If no log-file is specified on the command line, this command expects its input on stdin. Thus, the output of lintian can either be piped
       through lintian-info or a log file produced by lintian can be processed with this command.  (Note, though, that the lintian command has a
       command line option -i to display the same results as lintian-info, so you will not normally need to pipe the output of lintian into this
       command.)

OPTIONS
       -a, --annotate
	   Read from standard input or any files specified on the command line and search the input for lines formatted like Lintian override
	   entries.  For each one that was found, display verbose information about that tag.

       -h, --help
	   Display usage information and exit.

       --profile prof
	   Use the severities from the vendor profile prof when displaying tags.  If the profile name does not contain a slash, the default
	   profile for than vendor is chosen.

	   If not specified, lintian-info loads the best profile for the current vendor.

	   Please Refer to the Lintian User Manual for the full documentation of profiles.

       -t, --tags
	   Rather than treating them as log file names, treat any command-line options as tag names and display the descriptions of each tag.

EXIT STATUS
       If -t or --tags was given and one or more of the tags specified were unknown, this command returns the exit code 1.  Otherwise, it always
       returns with exit code 0.

SEE ALSO
       lintian(1)

AUTHORS
       Niels Thykier <niels@thykier.net>

       Richard Braakman <dark@xs4all.nl>

       Christian Schwarz <schwarz@monet.m.isar.de>

perl v5.14.2							    2013-02-16							   LINTIAN-INFO(1)
All times are GMT -4. The time now is 06:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy