10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everyone, I would really appreciate any help I could get on the following topic.
I am not very familiar with reg expressions nor with sed, I just know the basic uses. What I am trying to do is the following: I have a huge text file where I would like to replace all occurnces of a certain... (13 Replies)
Discussion started by: Boxtuna
13 Replies
2. Shell Programming and Scripting
HI..
I made ".bat" in windows 2003 , with
set TIEMPO1= %TIME% | sed -e "s/://g" -e "s/,//g"
echo valor de tiempo1 = %TIEMPO1%
when i execute this, the result is
but if i open cmd, and execute en line command this..
G:\>echo %TIME% | sed -e "s/://g" -e "s/,//g"
12390841
anyone have... (5 Replies)
Discussion started by: upszot
5 Replies
3. Shell Programming and Scripting
Hi,
maybe it is stupid question, but is it possible to match expression like this ? :
... // ... ( there is "//" somewhere on the line and on the end of the line there ISN'T "*/" )
I've tried something like : (in SED)
sed 's/\/\/'
but I need "*/" not to be on the end of the line ...... (2 Replies)
Discussion started by: kolage
2 Replies
4. Shell Programming and Scripting
Hi folks. I would like to remove the full parent (outer) xml tag from a file given a matching child (inner) tag, in a bash shell.
To be more specific, this is what I have so far:
$ cat myFile.xml
<Sometag></Sometag>
<Outer>
<Inner>1</Inner>
</Outer>
<Outer>
<stuff>alot</stuff>
... (3 Replies)
Discussion started by: BatManWSL
3 Replies
5. Shell Programming and Scripting
Hello,
I cannot see what's wrong in my code.
When I run code below, it just print an empty string.
my $test = "SWER~~ERTGSDFGTHAS_RTAWGA_DFAS.x4-234253454.in";
if ($test = ~ m/\~{1,2}.*4/) {
print "$1\n";
}
else {
print "No match...\n";
}
Anyone know what I'm doing wrong?
... (4 Replies)
Discussion started by: urandom
4 Replies
6. UNIX for Dummies Questions & Answers
Dear all
i have the code which print 1 line of context before and after regexp, with line number
sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h
the code work well but any one can tell me what each letter mean {=;x;1!p;g;$!N;p;D;}
also how i can print 2 line before and onle line after ... (2 Replies)
Discussion started by: soly
2 Replies
7. Shell Programming and Scripting
Hi,
I am not that good with reg exp and sed. But I was just looking at something the other day and came across a situation.
When I ran the below command:
echo "123 word" | sed 's/*/(&)/'
the op was:
(123) word
But when I ran:
echo "123 word" | sed 's/*/(&)/g'
the o/p was:
(123)... (4 Replies)
Discussion started by: King Nothing
4 Replies
8. Shell Programming and Scripting
I installed the GnuWin32 tools on my Windows XP system but I cannot .. for the life of me .. get the SED tool to work for me.
All I need to do is remove blank lines for a text file. My script is ...
sed -e '/^$/ d' xxx.txt > yyy.txt
The error msg is: sed: -e expression #1, char 1: unknown... (1 Reply)
Discussion started by: HOLMBERG
1 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
please help:
I want to add 1 space between string and numbers:
input file:
abcd12345
output file:
abcd 1234
The following sed command does not work:
sed 's/\(+\)\(+\)/\1 \2/' file
Any ideas, please
Andy (2 Replies)
Discussion started by: andy2000
2 Replies