03-15-2008
If pattern is going to be the same then use this
echo "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031" |cut -d ' ' -f4|cut -d _ -f2
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
Can you help me with this ,
I need to search a pattern replace it with the new pattern in all the files in a directory.
what would be the easiest way to do that?
Thanks in advance. :)
Sam, (6 Replies)
Discussion started by: sbasetty
6 Replies
2. Shell Programming and Scripting
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies
3. Shell Programming and Scripting
Hi
i want to search two pattern on same line and replace onther pattern..
INPut file
aaaa bbbbb nnnnnn ttttt
cccc bbbbb nnnnnn ppppp
dddd ccccc nnnnnn ttttt
ffff bbbbb oooooo ttttt
now i want replace this matrix like.. i want search for "bbbbb","nnnnnn" and search and replace for... (4 Replies)
Discussion started by: nitindreamz
4 Replies
4. Shell Programming and Scripting
Hi guys,
got a problem here with sed on the command line.
If i have a string as below:
online xx:wer:xcv: sdf:/asdf/http:https-asdfd
How can i match the pattern "http:" and replace the start of the string to the pattern with null?
I tried the following but it doesn't work:
... (3 Replies)
Discussion started by: DrivesMeCrazy
3 Replies
5. Shell Programming and Scripting
I have three variables $a, $b and $c
$a = file_abc_123.txt
$b = 123
$c = 100
I want to search if $b is present in $a. If it is present, then i want to replace that portion by $c.
Here $b = 123 is present in "file_abc_123.txt", so i need the output as "file_abc_100.txt'
How can this be... (3 Replies)
Discussion started by: irudayaraj
3 Replies
6. Shell Programming and Scripting
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Discussion started by: saurabh kumar
9 Replies
7. Shell Programming and Scripting
Not able to paste my content. Please see the attachment :-( (2 Replies)
Discussion started by: vivek d r
2 Replies
8. Shell Programming and Scripting
Hi Guys!
Unix newbie here!
Have a requirement for which I have been scouting the forums for a solution but has been out of luck so far :(
I have a file which contains the following:-
TEST1|TEST2|"TEST3|1@!2"|TEST5
My sed command should result in either one the following output:-... (6 Replies)
Discussion started by: hishamzz
6 Replies
9. Shell Programming and Scripting
The intended result should be :
PDF converters
'empty line'
gpdftext and pdftotext?xml version="1.0"?>
xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters
gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies
10. UNIX for Beginners Questions & Answers
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT PHP
numfmt_set_pattern
NUMFMT_SET_PATTERN(3) 1 NUMFMT_SET_PATTERN(3)
NumberFormatter::setPattern - Set formatter pattern
Object oriented style
SYNOPSIS
public bool NumberFormatter::setPattern (string $pattern)
DESCRIPTION
Procedural style
bool numfmt_set_pattern (NumberFormatter $fmt, string $pattern)
Set the pattern used by the formatter. Can not be used on a rule-based formatter.
PARAMETERS
o $fmt
-NumberFormatter object.
o $pattern
- Pattern in syntax described in ICU DecimalFormat documentation.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
numfmt_set_pattern(3) example
<?php
$fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL );
echo "Pattern: ".numfmt_get_pattern($fmt)."
";
echo numfmt_format($fmt, 1234567.891234567890000)."
";
numfmt_set_pattern($fmt, "#0.# kg");
echo "Pattern: ".numfmt_get_pattern($fmt)."
";
echo numfmt_format($fmt, 1234567.891234567890000)."
";
?>
Example #2
OO example
<?php
$fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL );
echo "Pattern: ".$fmt->getPattern()."
";
echo $fmt->format(1234567.891234567890000)."
";
$fmt->setPattern("#0.# kg");
echo "Pattern: ".$fmt->getPattern()."
";
echo $fmt->format(1234567.891234567890000)."
";
?>
The above example will output:
Pattern: #,##0.###
1.234.567,891
Pattern: #0.# kg
1234567,9 kg
SEE ALSO
numfmt_get_error_code(3), numfmt_create(3), numfmt_get_pattern(3).
PHP Documentation Group NUMFMT_SET_PATTERN(3)