Sponsored Content
Full Discussion: Regex problem
Top Forums Programming Regex problem Post 302675035 by gunjanamit on Saturday 21st of July 2012 09:43:46 AM
Old 07-21-2012
Regex problem

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!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep regex problem

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)
Discussion started by: iceman
2 Replies

2. Solaris

gcc 3.4 Regex problem

Hello All, I have been using String.h with gcc 2.95. Now I have upgraded to gcc 3.4. The support for String.h has been removed and I believe Regex.h support is also not inbuilt. So I tried to build my own library for String.h. I had to use Regex.h and rx.h for a succesful library compilation.... (0 Replies)
Discussion started by: manishs13
0 Replies

3. Shell Programming and Scripting

Simple regex problem?

Hi all, I am looking to create words from a sentence which adhere to a custom search pattern from my website: Example: ! +! / += ~ where the terms ! = not, +! = AND NOT, += - and equals and ~ = can be like.... Now here is the issue...i want to split a sentence like the one above on... (1 Reply)
Discussion started by: muay_tb
1 Replies

4. Shell Programming and Scripting

regex problem

Hi, #!/usr/bin/perl -w my $timestamp; my $line = "Fri May 29 18:29:57.357 2009 Morocco Standard Time INFO: pid 3216 tid 1724: 170: 132192: apricocot Native Server: recvd AA_BIN_MSG_VER_CHG"; if ($line =~ /^(.*) INFO: .* recvd AA_BIN_MSG_VER_CHG/) { $timestamp = $1; ... (1 Reply)
Discussion started by: namishtiwari
1 Replies

5. UNIX for Dummies Questions & Answers

regex problem with +

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)
Discussion started by: che9000
2 Replies

6. Programming

REGEX problem

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)
Discussion started by: omoyne
4 Replies

7. Shell Programming and Scripting

Need some help with a regex if loop problem

Need some help with a regex if loop problem. File1: 2323 3232 4230 3230 4340 4343 233 32320 I want to print "Zero" if the number ends with a zero, but print "number" if it does not! #!/bin/bash /usr/bin/nawk '{ if ($1 ==/+0\b/){ print "Zero"} else{ print "number"} (5 Replies)
Discussion started by: linuxkid
5 Replies

8. UNIX for Advanced & Expert Users

Sed regex problem

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)
Discussion started by: thiuda
9 Replies

9. Shell Programming and Scripting

awk regex problem

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)
Discussion started by: aishsimplesweet
31 Replies

10. Shell Programming and Scripting

Perl Regex problem

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)
Discussion started by: mrlayance
5 Replies
dgscat(1)						      PT-Scotch user's manual							 dgscat(1)

NAME
dggath, dgscat, gscat - convert distributed source graphs to or from centralized ones SYNOPSIS
dggath [options] [igfile] [ogfile] dgscat [options] [igfile] [ogfile] gscat [options] [igfile] [ogfile] DESCRIPTION
The dggath program gathers distributed graphs into centralized graphs. It reads a set of files igfile representing fragments of a distrib- uted source graph, and writes them back on the form of a single centralized source graph ogfile. The dgscat program scatters centralized source graphs into distributed graphs. It reads a centralized source graph igfile and writes it back on the form of a set of files ogfile representing fragments of the corresponding distributed source graph. The gscat program does exactly the same as dgscat, but does not require to be run in a parallel environment. Since gscat processes the input centralized graph file as a text stream, it does not need to load the full graph in memory before building the distributed graph fragment files. It is therefore much less resource consuming, but does not allow for the checking of graph consistency, as it has no global vision of the graph structure. When file names are not specified, data is read from standard input and written to standard output. Standard streams can also be explicitly represented by a dash '-'. When the proper libraries have been included at compile time, dggath and dgscat can directly handle compressed graphs, both as input and output. A stream is treated as compressed whenever its name is postfixed with a compressed file extension, such as in 'brol.grf.bz2' or '-.gz'. The compression formats which can be supported are the bzip2 format ('.bz2'), the gzip format ('.gz'), and the lzma format ('.lzma', on input only). dggath and dgscat base on implementations of the MPI interface to spread work across the processing elements. It is therefore not likely to be run directly, but instead through some launcher command such as mpirun. DISTRIBUTED FILE NAMES
In order to tell whether programs should read from, or write to, a single file located on only one processor, or to multiple instances of the same file on all of the processors, or else to distinct files on each of the processors, a special grammar has been designed, which is based on the '%' escape character. Four such escape sequences are defined, which are interpreted independently on every processor, prior to file opening. By default, when a filename is provided, it is assumed that the file is to be opened on only one of the processors, called the root processor, which is usually process 0 of the communicator within which the program is run. The index of the root processor can be changed by means of the -r option. Using any of the first three escape sequences below will instruct programs to open in parallel a file of name equal to the interpreted filename, on every processor on which they are run. %p Replaced by the number of processes in the global communicator in which the program is run. Leads to parallel opening. %r Replaced on each process running the program by the rank of this process in the global communicator. Leads to parallel opening. %- Discarded, but leads to parallel opening. This sequence is mainly used to instruct programs to open on every processor a file of identical name. The opened files can be, according whether the given path leads to a shared directory or to directories that are local to each processor, either to the opening of multiple instances of the same file, or to the opening of distinct files which may each have a different content, respectively (but in this latter case it is much recommended to identify files by means of the '%r' sequence). %% Replaced by a single '%' character. File names using this escape sequence are not considered for parallel opening, unless one or several of the three other escape sequences are also present. For instance, filename 'brol' will lead to the opening of file 'brol' on the root processor only, filename '%-brol' (or even 'br%-ol') will lead to the parallel opening of files called 'brol' on every processor, and filename 'brol%p-%r' will lead to the opening of files 'brol2-0' and 'brol2-1', respectively, on each of the two processors on which the program were to run. OPTIONS
-c For dggath and dgscat only. Check the consistency of the input source graph after loading it into memory. -h Display some help. -rpnum Set root process for centralized files (default is 0). -V Display program version and copyright. EXAMPLE
Run dgscat on 5 processing elements to scatter centralized graph file brol.grf into 5 gzipped file fragments brol5-0.dgr.gz to brol5-4.dgr.gz. $ mpirun -np 5 dgscat brol.grf brol%p-%r.dgr.gz SEE ALSO
dgmap(1), dgord(1), dgtst(1), gmk_hy(1). PT-Scotch user's manual. AUTHOR
Francois Pellegrini <francois.pellegrini@labri.fr> August 03, 2010 dgscat(1)
All times are GMT -4. The time now is 01:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy