10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
I need to print the characters in the previous line just before the regular expression match
Please have a look at the input file as attached
I need to match the regular expression ^ with the character of the previous like and also the pin numbers
and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
2. Shell Programming and Scripting
Trying to find and replace one string with another string in a file
#!/usr/bin/perl
$csd_table_path = "/file.ntab";
$find_str = '--bundle_type=021';
$repl_str = '--bundle_type=021 --target=/dev/disk1s2';
if( system("/usr/bin/perl -p -i -e 's/$find_str/$repl_str/' $csd_table_path")... (2 Replies)
Discussion started by: cillmor
2 Replies
3. Shell Programming and Scripting
Hi all,
I am trying to filter out those lines that contain a "non-alpha" character.
An example of my input is the following:
zygnematales grb
zygocactus grb
zygocactus_truncatus plt
zygodactyl_foot prt
zygoma prt
zygomatic prt
zygomatic_arch prt
zygomatic_bone ... (2 Replies)
Discussion started by: owwow14
2 Replies
4. Shell Programming and Scripting
I need help with a regexp to find out the ip address which can possibly be present in a URL.
The URLs can be in any of the following form
<domain>?a=12345&d=somestring1
<domain>?c=10.10.10.100&d=somestring1
<domain>?a=12345&b=somestring1&c=10.1.2.4d=somestring2... (3 Replies)
Discussion started by: ampak
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am learning reg exp a bit :)
Meta char info:
{n,m} Matches the preceding character at least n times but not more than m times, for example, 'ba{2,3}b' will find 'baab' and 'baaab' but NOT 'bab' or 'baaaab'. Values are enclosed in braces (curly brackets).
Input file:
112
11112... (2 Replies)
Discussion started by: dragon.1431
2 Replies
6. Shell Programming and Scripting
Hi,
I searched in the forums, but I didn't find a good solution. My problem is:
I have a string like "TEST.ABC201005.MONTHLY.D101010203".
I just want to have the string until the D100430, so that the string should look like: "TEST.ABC201005.MONTHLY.D"
The last characters after the D can be... (8 Replies)
Discussion started by: elifchen
8 Replies
7. Shell Programming and Scripting
Hi,
I wonder if its possible to do the following task using rename (perl v5.8.8).
I want to find filenames matching the specific pattern and then change chosen character of this pattern to a given character, e.g. do the following renaming:
regexp: 'ab' -----> 'a0b'
What's the simplest... (0 Replies)
Discussion started by: pms
0 Replies
8. Shell Programming and Scripting
I use SAS (a statistical software) and have to remove last character or the last 1/2 numbers that appear after characters from the string using Perl Regular Expression (which is recognized by SAS).
Input: f183ii10 f183ii2 f182ii1 f182ii2 f183iim f22ii f22ii11 f22ii12 pmh4 pmhm
Desired... (2 Replies)
Discussion started by: ospreyeagle
2 Replies
9. Shell Programming and Scripting
Hello Experts,
Can someone help me here:
I have a variable which contains a string with "".
set var1 {a}
set str1 {a is the element i want to match}
Now "regexp $var1 $str1" does not work?
("regexp {a\} $str1" works, but var1 gets it's value automatically from another script)
Is... (6 Replies)
Discussion started by: sumitgarg
6 Replies
10. Shell Programming and Scripting
Hi everybody
for file in *
#Bash performs filename expansion
#+ on expressions that globbing recognizes.
do
output="`grep -n "$1" "$file"`"
echo "$file: `expr "$output" : '\(^.*$\)'`"
done
In the above bash script segment, I try to print just the first line of string named... (3 Replies)
Discussion started by: jonas.gabriel
3 Replies