Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
How would I accomplish this if I want to test to see if it
1) starts with a dash so something like "-R"
AND
2) starts with 1 character then either a "-" or "+" and then up to 3 characters such as "a+rx" (3 Replies)
We are getting extended Ascii characters in the input file and my requirement is to search and replace them with a space. I am using the following command
LANG=C sed -e 's// /g'
It is doing a good job, but in some cases it is replacing the extended characters with two spaces. So my input... (12 Replies)
1st_FILE.cnf
Here is my sample test file .
This will be replaced by .
2nd_FILE.cnf
This is my 2nd test file ..This is agian a test file for purpose.
variable.txt
TST_FILE=1st_FILE.txt
FILE_NAME=1st_FILE.txt
2ND_TST_FILE=2nd_FILE.txt
REASON=test
I have 2 sample config file under... (13 Replies)
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 Replies)
I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this.
string(Scenario 1)- user::r--,user::ourfrd:r--
String(Scenario 2)- user::r--
File
****
# file: /local/Desktop/myfile
# owner: me
# group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
LEARN ABOUT DEBIAN
ouse
ouse(3pm) User Contributed Perl Documentation ouse(3pm)NAME
ouse - syntactic sugar to make Mouse one-liners easier
SYNOPSIS
# create a Mouse class on the fly ...
perl -Mouse=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
# loads an existing class (Mouse or non-Mouse)
# and re-"opens" the package definition to make
# debugging/introspection easier
perl -Mouse=+My::Class -e 'print join ", " => __PACKAGE__->meta->get_method_list'
DESCRIPTION
ouse.pm is a simple source filter that adds "package $name; use Mouse;" to the beginning of your script and was entirely created because
typing perl "-e'package Foo; use Mouse; ...'" was annoying me... especially after getting used to having "-Moose" for Moose.
INTERFACE
"ouse" provides exactly one method and it is automatically called by perl:
"oose->import()">
Pass a package name to import to be used by the source filter.
DEPENDENCIES
You will need Filter::Simple and eventually Mouse
INCOMPATIBILITIES
None reported. But it is a source filter and might have issues there.
SEE ALSO
oose for "perl -Moose -e '...'"
AUTHOR
For all intents and purposes, blame:
Chris Prather "<perigrin@cpan.org>"
...who wrote oose.pm, which was adapted for use by Mouse by:
Ricardo SIGNES "<rjbs@cpan.org>"
COPYRIGHT AND LICENSE
Copyright 2008 Shawn M Moore.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-06-30 ouse(3pm)