$ cat in1.txt
Send("+{TAB 133}")
Send("+{TAB 135}")
Send("+{TAB 136}")
Send("+{TAB 137}")
$ cat in1.txt | perl -e 'while(<>){if ($_=~/(Send\("\+\{TAB )(\d{3})(\}"\))/){ $a=$2+1;print $1.$a.$3."\n"; }}'
Send("+{TAB 134}")
Send("+{TAB 136}")
Send("+{TAB 137}")
Send("+{TAB 138}")
$ cat in2.txt
wiki_1()
wiki_2()
wiki_3()
wiki_4()
wiki_5()
wiki_6()
$ cat in2.txt | perl -e 'while(<>){if ($_=~/(wiki_\d+)(\(\))/){ print $1."a".$2."\n"; }}'
wiki_1a()
wiki_2a()
wiki_3a()
wiki_4a()
wiki_5a()
wiki_6a()
affiliatewire_(.*?)_
<?php
$re = "/affiliatewire_(.*?)_/";
$str = "param0_test1_param1_affiliatewire_name1_test2_param2_param3
param0_test1_param1_affiliatewire_name_test2_param2_param3
param0_test1_param1_affiliatewire_trollolo_test2_param2_param3";
preg_match_all($re, $str, $matches);
print_r($matches);
?>
Array
(
[0] => Array
(
[0] => affiliatewire_name1_
[1] => affiliatewire_name_
[2] => affiliatewire_trollolo_
)
[1] => Array
(
[0] => name1
[1] => name
[2] => trollolo
)
)
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a group
separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.
-C NUM, -NUM, --context=NUM
Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.
cat <ваш файл>| perl -e '$i=0;while(<>){my @count=/(\")/g; $i++; $im=scalar @count; if ($im%2!=0){print $i." ".$_."\n";}}'
51,"Неизвестно 1"
52,"Неизвестно 2"
53,"Неизвестно 3"
54,"Неизвестно 4
55,"Неизвестно 5"
56,"Неизвестно 6"
57,"Неизвестно 7
125,""
4 54,"Неизвестно 4
7 57,"Неизвестно 7