Hi Friends,
Can any one help with this issue:
How to trim spaces for each line at the end,
Like I have a file in this format.
EMP1 SMITH 46373 5 STREET HOWARD 74636
EMP2 JONES 5454 { these are spaces ........}
EMP3 SMITH 46373 5 STREET HOWARD 74636
EMP4 JON 2554 { these are... (1 Reply)
How to append constant No of spaces suppose 52 at end of each line in a file (xyz) excluding first and last line.
Please Help me out for the same. (1 Reply)
hi i have a file like (every string contains 16 chars)
CTL1330000000000
0000 00
008000
0080000000
i need to form a line and write to a file
CTL13300000000000000 00008000 0080000000
total chars should be 64
... (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)
I have a script wherein I access each line of the file using a FOR loop and then perform some operations in each line. The problem is each line that gets extracted in FOR loop truncates trailing blank spaces and control characters (^M) that is present at the end of each line. I don't wan this to... (5 Replies)
Hello, could you please help with this one. I have an input file like this:
123,4567,89000
123456789,9876543,12
and for the output I need strings to be with the fixed length, let's say 15, and if the string is -lt 15 to be populated with blanks at the end until it reach 15, like this:
123 ,4567... (1 Reply)
I want to make a script to read row by row and find its length. If the length is less than my required length then i hav to append spaces to that paritucular row. Each row contains special characters, spaces, etc.
For example my file contains ,
12345 abcdef
234 abcde
89012 abcdefgh
... (10 Replies)
I have a file of about 10k records and eace line is having an extra space of 5 byte at the end.. Iwant to remove the extra spaces at the end of each line.. Can someone please help me out.. I tried using sed command and its not working... can someone please help me out. (3 Replies)
I have a file which contains the data lines like below.I want to remove the tab spaces at the end of each line.I have tried with the command sed 's/\+$//' file.but it does not work.Can anyone help me on this?
15022 15022 15022 15022 15022 15022
15023 15023 15023 15023 15023 ... (16 Replies)
Discussion started by: am24
16 Replies
LEARN ABOUT DEBIAN
mojo::exception
Mojo::Exception(3pm) User Contributed Perl Documentation Mojo::Exception(3pm)NAME
Mojo::Exception - Exceptions with context
SYNOPSIS
use Mojo::Exception;
my $e = Mojo::Exception->new;
DESCRIPTION
Mojo::Exception is a container for exceptions with context information.
ATTRIBUTES
Mojo::Exception implements the following attributes.
"frames"
my $frames = $e->frames;
$e = $e->frames($frames);
Stacktrace.
"line"
my $line = $e->line;
$e = $e->line([3, 'foo']);
The line where the exception occured.
"lines_after"
my $lines = $e->lines_after;
$e = $e->lines_after([[1, 'bar'], [2, 'baz']]);
Lines after the line where the exception occured.
"lines_before"
my $lines = $e->lines_before;
$e = $e->lines_before([[4, 'bar'], [5, 'baz']]);
Lines before the line where the exception occured.
"message"
my $message = $e->message;
$e = $e->message('Oops!');
Exception message.
"raw_message"
my $message = $e->raw_message;
$e = $e->raw_message('Oops!');
Raw unprocessed exception message.
"verbose"
my $verbose = $e->verbose;
$e = $e->verbose(1);
Activate verbose rendering, defaults to the value of "MOJO_EXCEPTION_VERBOSE" or 0.
METHODS
Mojo::Exception inherits all methods from Mojo::Base and implements the following new ones.
"new"
my $e = Mojo::Exception->new('Oops!');
my $e = Mojo::Exception->new('Oops!', $files, $name);
Construct a new Mojo::Exception object.
"throw"
Mojo::Exception->throw('Oops!');
Mojo::Exception->throw('Oops!', $files, $name);
Throw exception with stacktrace.
"to_string"
my $string = $e->to_string;
my $string = "$e";
Render exception with context.
"trace"
$e = $e->trace;
$e = $e->trace(2);
Store stacktrace.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::Exception(3pm)