Search Results

Search: Posts Made By: k_manimuthu
2,736
Posted By k_manimuthu
Try the below codes and integrate into your...
Try the below codes and integrate into your script.
#!/bin/sh
#By default array string tokenizer considered as space, But we need entire line.
# So whitespace replaced as _SPACE_
F1=( `cat...
19,025
Posted By k_manimuthu
perl -i -pe 'BEGIN{undef $/;} s/^/$ARGV\n/' `find...
perl -i -pe 'BEGIN{undef $/;} s/^/$ARGV\n/' `find . -name '*.txt'`
1,371
Posted By k_manimuthu
perl -ne '/(\d+)/; if ( $1 >= 6 && $1 <= 10...
perl -ne '/(\d+)/; if ( $1 >= 6 && $1 <= 10 ){print}' temp.txt
perl -ne '/(\d+)/; if ( $1 >= 11 && $1 <= 100 ){print}' temp.txt
perl -ne '/(\d+)/; if ( $1 >= 101 ){print}' temp.txt
1,241
Posted By k_manimuthu
perl -ne 'print if(s/:+/$&/g <= 6)' input_file >...
perl -ne 'print if(s/:+/$&/g <= 6)' input_file > Output_file
1,241
Posted By k_manimuthu
perl -ne 'print if(s/:/:/g <= 6)' input_file >...
perl -ne 'print if(s/:/:/g <= 6)' input_file > Output_file
1,580
Posted By k_manimuthu
Yes, this is possible for the mentioned module
Yes, this is possible for the mentioned module
57,328
Posted By k_manimuthu
my %delim; # Declare the hashes for ($file[0]...
my %delim; # Declare the hashes
for ($file[0] =~ m{[^\w\n\.]+}g)
{
$delim = $&;
$max++;
if ($max > 0)
{
$destr = $&; # assign the delimiter string to a variable
}
}
57,328
Posted By k_manimuthu
For find the delimiter, we don't to need analyze...
For find the delimiter, we don't to need analyze the full file. we read the first line of the file is enough. Which string appears maximum time that treaded as the delimter.

The above code @file...
1,097
Posted By k_manimuthu
Yes, by using of quotemeta function it is...
Yes, by using of quotemeta function it is possible

my $delim = '|';
print "delim = <$delim> \n";
# Add escape sequence non-word characters
$delim=quotemeta($delim);
my $word = "I|know|you";...
12,234
Posted By k_manimuthu
# That can be done by hashes concept @Array1 =...
# That can be done by hashes concept
@Array1 = qw(Fa0/0 Fa0/1 Fa0/2 Fa0/3);
@Array2 = qw(Fa0/1 Fa0/2 Fa0/3 Fa0/4);
# process two array , increment the values and store into hash
$hash{$_}++ for...
3,667
Posted By k_manimuthu
perl -i -pe ' BEGIN{undef $/;}$bak=$_; while...
perl -i -pe '
BEGIN{undef $/;}$bak=$_;
while ($bak=~m/<A\s+HREF.*?<\/A>/gs){$x=$y=$&; $y=~ s/\s+/ /g; $_=~s/$x/$y/gs;}
' temp.txt
3,756
Posted By k_manimuthu
I update my previous post. Try the updated code.
I update my previous post. Try the updated code.
3,756
Posted By k_manimuthu
perl -i -pe 'undef $/;...
perl -i -pe 'undef $/; s/<(Opt)>-L\$ORACLE_HOME.*?<\/\1>([^\n]*\n){2}//s; ' infile
2,478
Posted By k_manimuthu
perl -lne 'if (!$f){$n=$_; $f=1}else{$_.=$n;...
perl -lne 'if (!$f){$n=$_; $f=1}else{$_.=$n; print} ' file1.txt file2.txt
2,975
Posted By k_manimuthu
perl -i -pe ' BEGIN{ %h=qw( JAN 01 ...
perl -i -pe '
BEGIN{
%h=qw(
JAN 01
FEB 02
MAR 03
APR 04
MAY 05
JUN 06
JUL 07
AUG 08
SEP 09
OCT 10
NOV 11
DEC 12
);} foreach $k (keys %h){...
Forum: HP-UX 10-27-2010
16,349
Posted By k_manimuthu
use strict; use warnings; undef $/; my...
use strict;
use warnings;

undef $/;
my $file_name="unix.txt";
open (FIN, "$file_name");
my $file=<FIN>;
close (FIN);

$file=~ s{([^,]+,){3}\w+}{&clean_up($&)}ges;

open (FOUT,...
4,555
Posted By k_manimuthu
perl -i -pe 's/^\s+$//g' file
perl -i -pe 's/^\s+$//g' file
2,793
Posted By k_manimuthu
perl -lne '$/="END";print $_."END" if /0003\/02/'...
perl -lne '$/="END";print $_."END" if /0003\/02/' file

For the above code END matches with SUBEND

So you add carriage return (\n) in your code

perl -lne '$/="\nEND";print $_."\nEND" if...
2,198
Posted By k_manimuthu
perl -i -pe 's/(.*?)(tc_\d*)(.*)/$2/' input_file
perl -i -pe 's/(.*?)(tc_\d*)(.*)/$2/' input_file
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy