Sponsored Content
Full Discussion: Pad zeros to a number
Top Forums Shell Programming and Scripting Pad zeros to a number Post 302133577 by anumkoshy on Friday 24th of August 2007 04:10:32 AM
Old 08-24-2007
thanks a lot

it worked Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

number pad?

Is there anyway to use the fr*$%& number pad in VI? Anyway? Anyway at all? All it does now random movements and inserts of characters (2 Replies)
Discussion started by: nelsonenzo
2 Replies

2. UNIX Desktop Questions & Answers

HPUX 10.2 number pad

I have a keyboard that the number pad will not work. I cannot find the location of the configuration file to get it to work. I have to say, I have not tried another keyboard as my location is remote. Any suggestions? (0 Replies)
Discussion started by: esimeroth
0 Replies

3. Solaris

number pad in vi

Hi, I'm on a sunos SVR4.0 box, my number pad works on the command line but does not work in vi any ideas how to enable it under vi? Thanks (5 Replies)
Discussion started by: c19h28O2
5 Replies

4. UNIX for Dummies Questions & Answers

pad Zeros

Hi can I know command to pad Zeros to a value I get 16 and I need to send 0000000016 (5 Replies)
Discussion started by: mgirinath
5 Replies

5. Shell Programming and Scripting

Removing Zeros in front of a number

Hi All, I would like to trim the following input. My condition is as long as there's a zero on the left of the number, remove the zeros. Can anybody help me by using sed or awk ? Eg: 0011 => change to => 11 0333 => change to => 333 4444 => No change => 4444 (13 Replies)
Discussion started by: Raynon
13 Replies

6. Programming

How to right pad with zeros using sprintf?

I need to right-pad with zeros a string by using (s)printf. I looked up the manual and tried with printf("%-19s", buffer); which right-pad the string with spaces. So I tried printf("%019s", buffer); which left-pad the string with zeros. So I tried both printf("%-019s", buffer);... (9 Replies)
Discussion started by: emitrax
9 Replies

7. Shell Programming and Scripting

awk to remove leading zeros for a hex number

Is it possible by using awk to remove leading zeros for a hex number? ex: 0000000011179E0A -> 11179E0A Thank you! (4 Replies)
Discussion started by: carloszhang
4 Replies

8. Shell Programming and Scripting

Pad Zeros at the end

I have number/strings like below input =23412133 output = 234121330000 (depends on the number give at runtime) i need to padd zeros based on runtime input . i tried below printf ' %d%04d\n', "23412133"; But the precision 4 is static here how can i pass this as runtime input. i am... (11 Replies)
Discussion started by: greenworld123
11 Replies

9. Shell Programming and Scripting

How to pad with leading zeros for current time?

I'm using cygwin bash to submit scheduled tasks (kinda like cron jobs) in windows and the following script is giving me grief. I need to format the current time with leading zeros before 10AM for the hour field. In this example, I manually typed in "09:50" instead of using the `printf...`... (2 Replies)
Discussion started by: siegfried
2 Replies

10. Shell Programming and Scripting

Request: How to Parse dynamic SQL query to pad extra columns to match the fixed number of columns

Hello All, I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns. So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies
Rose::Object::MixIn(3pm)				User Contributed Perl Documentation				  Rose::Object::MixIn(3pm)

NAME
Rose::Object::MixIn - A base class for mix-ins. SYNOPSIS
package MyMixInClass; use Rose::Object::MixIn(); # Use empty parentheses here our @ISA = qw(Rose::Object::MixIn); __PACKAGE__->export_tag(all => [ qw(my_cool_method my_other_method) ]); sub my_cool_method { ... } sub my_other_method { ... } ... package MyClass; # Import methods my_cool_method() and my_other_method() use MyMixInClass qw(:all); ... package MyOtherClass; # Import just my_cool_method() use MyMixInClass qw(my_cool_method); ... package YetAnotherClass; # Import just my_cool_method() as cool() use MyMixInClass { my_cool_method => 'cool' } DESCRIPTION
Rose::Object::MixIn is a base class for mix-ins. A mix-in is a class that exports methods into another class. This export process is controlled with an Exporter-like interface, but Rose::Object::MixIn does not inherit from Exporter. When you use a Rose::Object::MixIn-derived class, its import method is called at compile time. In other words, this: use Rose::Object::MixIn 'a', 'b', { c => 'd' }; is the same thing as this: BEGIN { Rose::Object::MixIn->import('a', 'b', { c => 'd' }) } To prevent the import method from being run, put empty parentheses "()" after the package name instead of a list of arguments. use Rose::Object::MixIn(); See the synopsis for an example of when this is handy: using Rose::Object::MixIn from within a subclass. Note that the empty parenthesis are important. The following is not equivalent: # This is not the same thing as the example above! use Rose::Object::MixIn; See the documentation for the import method below to learn what arguments it accepts. CLASS METHODS
import ARGS Import the methods specified by ARGS into the package from which this method was called. If the current class can already perform one of these methods, a fatal error will occur. To override an existing method, you must use the "-force" argument (see below). Valid formats for ARGS are as follows: o A method name Literal method names will be imported as-is. o A tag name Tags names are indicated with a leading colon. For example, ":all" specifies the "all" tag. A tag is a stand-in for a list of methods. See the export_tag method to learn how to create tags. o A reference to a hash Each key/value pair in this hash contains a method name and the name that it will be imported as. Use this feature to import methods under different names in order to avoid conflicts with existing methods. o "-force" The special literal argument "-force" will cause the specified methods to be imported even if the calling class can already perform one or more of those methods. o "-target_class CLASS" The special literal argument "-target-class" followed by a class name will cause the specified methods to be imported into CLASS rather than into the calling class. See the synopsis for several examples of the import method in action. (Remember, it's called implicitly when you use a Rose::Object::MixIn-derived class with anything other than an empty set of parenthesis "()" as an argument.) clear_export_tags Delete the entire list of export tags. export_tag NAME [, ARRAYREF] Get or set the list of method names associated with a tag. The tag name should not begin with a colon. If ARRAYREF is passed, then the list of methods associated with the specific tag is set. Returns a list (in list context) or a reference to an array (in scalar context) of method names. The array reference return value should be treated as read-only. If no such tag exists, and if an ARRAYREF is not passed, then a fatal error will occur. export_tags Returns a list (in list context) and a reference to an array (in scalar context) containing the complete list of export tags. The array reference return value should be treated as read-only. AUTHOR
John C. Siracusa (siracusa@gmail.com) LICENSE
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-04-27 Rose::Object::MixIn(3pm)
All times are GMT -4. The time now is 10:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy