Hi Unix gurus
This is my first post here. I have a file which looks like this:
string1,string2
,string3
,string4
...
...
I need to append all words below first line to the first line, ie
string1,string2,string3,string4,...
Bear in mind that it is not known how many lines follow... (11 Replies)
Hi,
i want to append a character '|' at end of each line of a file abc.txt.
for example if the file abc.txt conatins:
a|b|c
1|2|33
w|2|11
i want result file xyz.txt
a|b|c|
1|2|33|
w|2|11|
I know this is simple but sumhow i am not able to reach end of line.
its urgent, thanks for... (4 Replies)
-Hi
I have multiple files which contain a line with the word "exec". I need to add the following pattern " -cmode -ccheap" on the same line where "exec" is at the end. Any idea? Thanks a lot in advance to everybody... -A (2 Replies)
child_amt=$amount
prev_line="$prev_line $child_amt"
i am getting the result like this
21234567890001343 000001004OLFXXX029100020091112 0000060
but i want 8 spaces between the eg:
21234567890001343 000001004OLFXXX029100020091112 0000060
how can i do this in .ksh (1 Reply)
Hi,
I've spent some time researching for this but can't seem to find a solution. I have a file like this
1234|Test|20101111|18:00|19:00There will be multiple lines in the file with the same kind of format. For every line I need to make it this
1234|Test|20101111|18:00|19:00||create... (5 Replies)
I've scoured the internet with mixed results. As an amateur I turn to the great minds here.
I have a text file of 80 or so lines. I want to add ".pdf" to the end of each line. (For now that's it)
Most of the internet points toward using "sed". I don't know coding but can figure things out... (4 Replies)
After I create printer queues in AIX, I have to append a filter file location within that printers custom file. within lets say test_queue.txt I need to find the row that starts with :699 and then I need to append on the end the string /usr/local/bin/k_portrait.sh.
Now I've gotten the sed... (2 Replies)
Hi all.. I have several unique files that contain one thing in common, and that is acct#. For all files in the directory, I want to append the 10 characters following the word "ACCOUNT:" to the end of the filename.
for example:
I have file 111_123 that contains ACCOUNT:ABC1234567
The file... (5 Replies)
Platform: Solaris 10
I have a file like below
$ cat languages.txt
Spanish
Norwegian
English
Persian
German
Portugese
Chinese
Korean
Hindi
Malayalam
Bengali
Italian
Greek
Arabic
I want to append the string " is a great language" at end of each line in this file. (3 Replies)
Hi ,
I have pipe delimited file containing 12 columns having below data in AIX
Input :
A|B|C|D|E|F|G|H|I|J|K|L^M
A1|B1|C1|D1|E1^M
A2|B2|C2^M
So in first row i have 11 pipes which is fine.
In second row I have 4 pipes, so additional 7 pipes should get append
In third row I have 2... (3 Replies)
Discussion started by: sonu_pal
3 Replies
LEARN ABOUT CENTOS
mixin::linewise::readers
Mixin::Linewise::Readers(3) User Contributed Perl Documentation Mixin::Linewise::Readers(3)NAME
Mixin::Linewise::Readers - get linewise readers for strings and filenames
VERSION
version 0.004
SYNOPSIS
package Your::Pkg;
use Mixin::Linewise::Readers -readers;
sub read_handle {
my ($self, $handle) = @_;
LINE: while (my $line = $handle->getline) {
next LINE if $line =~ /^#/;
print "non-comment: $line";
}
}
Then:
use Your::Pkg;
Your::Pkg->read_file($filename);
Your::Pkg->read_string($string);
Your::Pkg->read_handle($fh);
EXPORTS
"read_file" and "read_string" are exported by default. Either can be requested individually, or renamed. They are generated by
Sub::Exporter, so consult its documentation for more information.
Both can be generated with the option "method" which requests that a method other than "read_handle" is called with the created IO::Handle.
read_file
Your::Pkg->read_file($filename);
If generated, the "read_file" export attempts to open the named file for reading, and then calls "read_handle" on the opened handle.
Any arguments after $filename are passed along after to "read_handle".
read_string
Your::Pkg->read_string($string);
If generated, the "read_string" creates an IO::String handle from the given string, and then calls "read_handle" on the opened handle.
Any arguments after $string are passed along after to "read_handle".
AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.16.3 2013-06-18 Mixin::Linewise::Readers(3)