10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. UNIX for Dummies Questions & Answers
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
10. Shell Programming and Scripting
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