Hi,
I'm not very familiar with unix shell. I want to replace the combination of two carriage returns and one newline with one carriage return and one newline. I think the best way to do this is to use sed. I tried something like this:
sed -e "s#\#\#g" file.txt
but it doesn't work.
Thanx... (2 Replies)
As the title suggests, i am having some trouble figuring out how to pass spaces and carriage returns to a 'here document' ie
#!/bin/bash
/usr/local/install_script.sh <<SCRIPT
yes
no
<pass carriage retun here>
yes
no
<pass a space and then a carriage return here>
exit
SCRIPT
any... (0 Replies)
Is there any way to remove carriage retuns between the records?
We have input records separated by TABS and have carriage returns as below:
123 456 789 ABC "1952.00" 678 "abcdef
ghik
lmno"
Above we... (10 Replies)
I need to replace thousands of carriage returns/line breaks in a large xml file and with spaces. I hope to do so with a script, called, for example, "removeCRs." I would invoke this at the command line as
ml5003$ sed -f /Users/ml5003/removeCRs oldFile > newFile
The script, I presume, would... (4 Replies)
Hello, I have read a few threads on this subject and tried a few things out, but still come up short.
There was one good example, then the last reply was something to the effect of 'Use Sed' & 'Read a book'...
Well I read a bunch of online tutorials on sed, awk, tr, but still can't get the... (2 Replies)
Hello,
I need help adding carriage returns at specific intervals (say 692 characters) to a text file that's one continous string. I'm working in AIX5.3. Any quick help is appreciated.
Thanks! (2 Replies)
I have a CSV with carriage returns in place of newlines. I am trying to use tr to remove them, but it isn't working.
Academic year,Term,Course name,Period,Last name,Nickname
2012-2013,First Semester,English 12,4th Period,Arnold,Adam
2012-2013,First Semester,English 12,4th Period,Adams,Jim... (1 Reply)
Hello Gurus,
I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file.
1|ABC DEF|100|10
2|PQ
RS
T|200|20
3| UVWXYZ|300|30
4| GHIJKL|400|40... (7 Replies)
I'm on Linux version 2.6.32-696.3.1.el6.x86_64, using the Ksh shell.
I'm working with the input file:
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams,... (2 Replies)
Discussion started by: prooney
2 Replies
LEARN ABOUT MOJAVE
moo::role
Moo::Role(3) User Contributed Perl Documentation Moo::Role(3)NAME
Moo::Role - Minimal Object Orientation support for Roles
SYNOPSIS
package My::Role;
use Moo::Role;
sub foo { ... }
sub bar { ... }
has baz => (
is => 'ro',
);
1;
And elsewhere:
package Some::Class;
use Moo;
# bar gets imported, but not foo
with('My::Role');
sub foo { ... }
1;
DESCRIPTION
"Moo::Role" builds upon Role::Tiny, so look there for most of the documentation on how this works. The main addition here is extra bits to
make the roles more "Moosey;" which is to say, it adds "has".
IMPORTED SUBROUTINES
See "IMPORTED SUBROUTINES" in Role::Tiny for all the other subroutines that are imported by this module.
has
has attr => (
is => 'ro',
);
Declares an attribute for the class to be composed into. See "has" in Moo for all options.
CLEANING UP IMPORTS
Moo::Role cleans up its own imported methods and any imports declared before the "use Moo::Role" statement automatically. Anything
imported after "use Moo::Role" will be composed into consuming packages. A package that consumes this role:
package My::Role::ID;
use Digest::MD5 qw(md5_hex);
use Moo::Role;
use Digest::SHA qw(sha1_hex);
requires 'name';
sub as_md5 { my ($self) = @_; return md5_hex($self->name); }
sub as_sha1 { my ($self) = @_; return sha1_hex($self->name); }
1;
..will now have a "$self->sha1_hex()" method available to it that probably does not do what you expect. On the other hand, a call to
"$self->md5_hex()" will die with the helpful error message: "Can't locate object method "md5_hex"".
See "CLEANING UP IMPORTS" in Moo for more details.
SUPPORT
See Moo for support and contact information.
AUTHORS
See Moo for authors.
COPYRIGHT AND LICENSE
See Moo for the copyright and license.
perl v5.18.2 2013-12-31 Moo::Role(3)