10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I need to remove DBPATH= and /db from the string below using awk (or sed, as it also exists on the machine).
Input: DBPATH=/some/path/database/db
Desired output: /some/path/database
Thank you! (8 Replies)
Discussion started by: ejianu
8 Replies
2. 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
3. Shell Programming and Scripting
I'm probably just not thinking of the correct term to search for :-) But I want to match a pattern that might be 'ABC' or '1ABC' there might be three characters, or there might be four, but if there are four, the first has to be 1 (1 Reply)
Discussion started by: jnojr
1 Replies
4. Shell Programming and Scripting
In a 10-50GB file , at end of file there is Control-z character
tried the below options,
1. perl -p -i -e 's/^Z//g' new.txt
2. perl -0777lwi -032e0 new.txt
and Sed command, dos2unix etc
it takes more time to remove the control-z. need a command or perl program to GO TO LAST LINE OF FILE ... (7 Replies)
Discussion started by: prsam
7 Replies
5. Shell Programming and Scripting
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies
6. 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
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 want to split the input by a space and remove specific characters like full stop, comma...... etc. and then save each word in an array.
i got something below, but it didn't work. can anyone please help me?
Thank you
#!/usr/bin/perl -w
while (<>)
{
$line = <>;
@word = split(' ',... (6 Replies)
Discussion started by: mingming88
6 Replies
9. Shell Programming and Scripting
Hello, i'm unable to remove the parenthesis character.
With $parsed_AsciiName =~ s/\(//;
the string is the same
And with $parsed_AsciiName =~ s/(//;
i retrieve "Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE"
Any ideas, please? thank you in advanced. (4 Replies)
Discussion started by: aristegui
4 Replies
10. 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