Hi,
I am trying to do something with grep, but for some reason I just can't get it to to work.
I am looking for find a match in the second field, the length must be 10 characters and end with 'abc'.
The file is in this format:
<int><tab><field2>
I've tried a few patterns, some work,... (2 Replies)
Hi,
Can someone tell me why the first regular expression with the + fails to match the input string?
SUN /web>echo cat | grep '+'
SUN /web>echo cat | grep ''
cat
I'm running SunOS 5.10
Thanks.
Chris (2 Replies)
Hi there,
How can we use regex in perl to store the Route Distinguisher (the bold field) and also the underlined and bold lines in the below file?
Note:
These highlighted pattern is redundant through the whole input file. Basically, we just need to extract these fields at least to store them... (4 Replies)
Hi,
I tried to extract the time from `date` with sed.
(I know it works with `date +%H:%M:%S` as well)
I got three solutions of which just one worked. I thought "+" should repeat the previous expression 1 or more times and {n} should repeat the previous expression n times.
$ date
Thu... (9 Replies)
hi everyone
suppose my input file is
ABC-12345
ABCD-12345
BCD-123456
i want to search the specific pattern which looks like
-
in a file so i used this command
cat $file | awk ' { if ($0 ~ /-/) { print } }'
so it gives me the result as
ABCD-12345
BCD-12345
BCD-12345
... (31 Replies)
Hi,
I am looking for regex to extract following words from text:
The word which comes after "Replaced" means
Replaced disk
Replaced floppy
Replaced memory
Please suggest the regex for it.
Thanks! (4 Replies)
I have a file1.txt with several 100k lines, each of which has a column 9 containing one of 60 "label" identifiers. Using an labels.txt file containing a list of labels, I'd like to extract 200 random lines from file1.txt for each of the labels in index.txt.
Using a contrived mini-example:
$ cat... (8 Replies)
I am trying to do in a single line to take a list of paths separated by whitespace and then loop thru all the paths that were wrote but my regex is not working,
I have
echo {3} | sed 's/ //g' | while read EACHFILE
do
.....
But for some reason is only taking always the first path that I... (7 Replies)
Script logs into switches on my list but nothing seems to happen.
Following error:
tr nope, doesn't (yet) match (?-xism:-]+ ?(?:\(config*\))? ? ?$)
du SEEN:
Here is code in question:
@version_info = $session_obj->cmd('term length 0');
$session_obj->cmd('show int | i... (5 Replies)