Sponsored Content
Top Forums Shell Programming and Scripting Removing Zeros in front of a number Post 302197993 by radoulov on Thursday 22nd of May 2008 04:02:12 AM
Old 05-22-2008
I'm not sure, do you mean this?

Code:
% printf "%s\n" 0011myfile myfile00220 my003303file|sed "s 00*\([1-9]*\) \1 "
11myfile
myfile220
my3303file
%

 

10 More Discussions You Might Find Interesting

1. HP-UX

Padding zeros after removing commas in file

Hi Gurus, There is a ASCII file in which a comma is used as a seperator for the amount field when the amount exceed seven digits: e.g. 0001300,000. Now, this comma needs to be removed from this field, after padding leading zeros (to maintain the ASCII positions) e.g. 00001300000.... (1 Reply)
Discussion started by: pranag21
1 Replies

2. Shell Programming and Scripting

Pad zeros to a number

Pad zeros to a number and assign it to a variable like i get 1 in $i ,i want it to be $i as 01 (6 Replies)
Discussion started by: anumkoshy
6 Replies

3. Shell Programming and Scripting

Removing leading zeros from a variable

How do I remove or add leading zeroa from a variable. To make variable 10 characters long when adding zeros. (6 Replies)
Discussion started by: toshidas2000
6 Replies

4. Shell Programming and Scripting

removing files with certain number in the first row

Hello! I have 32000 files in a directory and want to remove those with first row beging with 0.00; file names are in numbers from 1 through 32000; I have coded the following but it gives me error: while ( i <= 32000 ) if (head -1 $i ==0.00) rm $i end Well, i am sure even if this... (14 Replies)
Discussion started by: nxp
14 Replies

5. Shell Programming and Scripting

How do I print out lines with the same number in front using awk?

Hi, I need help in printing out the dates with the largest value in front of it using awk. 436 28/Feb/2008 436 27/Feb/2008 436 20/Feb/2008 422 13/Feb/2008 420 23/Feb/2008 409 21/Feb/2008 402 26/Feb/2008 381 22/Feb/2008 374 24/Feb/2008 360... (7 Replies)
Discussion started by: SIFA
7 Replies

6. Shell Programming and Scripting

Removing trailing zeros using sed

Hello All, I have a csv file with 3 columns. The file which looks like this 47850000,100,233 23560000,10000,456 78650000,560000,54 34000000,3456,3 The first column has 4 trailing zeros. I have to remove 4 trailing zeroes from 1st field. The output file should appear as follows. ... (12 Replies)
Discussion started by: grajp002
12 Replies

7. Shell Programming and Scripting

Removing leading zeros for a decimal column

removing leading zeros for a decimal column in a file which has string & decimal values ,,,,,6630140,XXXXXXXXXXXXXXX, 0020.00,USA ,,,,,6630150,XXXXXXXXXXXXXXXL (xyz, 0010.00,USA ,,,,,6630150,XXXXXXXXXXXXXXX(xyz), 1300.00,USA My file contains 9 columns. Out 9 columns, 8th column contains the... (9 Replies)
Discussion started by: marpadga18
9 Replies

8. 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

9. Shell Programming and Scripting

Fixed with file- removing leading zeros and adding the space

Hi All, i have a fixed width file , where each line is 3200 length. File: 1ABC 1111 2222 3333 000012341 1001 2ABC 1111 2222 3333 000012342 1002 3ABC 1111 2222 3333 000112343 1003 1DEF 5555 4444 9696 000012344 1004 2DEF 5555 2323 8686 000012345 1005 3DEF 5555 1212 7676 000012346 1006 ... (1 Reply)
Discussion started by: mechvijays
1 Replies

10. Shell Programming and Scripting

Removing large number of temp files

Hi All, I am having a situation now to delete a huge number of temp files created during run times approx. 16700+ files. We have never imagined that we will get this this much big list of files during run time. It worked fine for lesser no of files in the list. But when list is huge we are... (7 Replies)
Discussion started by: mad man
7 Replies
Heimdal Kerberos 5 error reporting functions(3) 	      HeimdalKerberos5library		   Heimdal Kerberos 5 error reporting functions(3)

NAME
Heimdal Kerberos 5 error reporting functions - Functions KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_eai_to_heim_errno (int eai_errno, int system_error) KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_h_errno_to_heim_errno (int eai_errno) KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_clear_error_message (krb5_context context) KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_error_message (krb5_context context, krb5_error_code ret, const char *fmt,...) __attribute__((format(printf KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarn (krb5_context context, krb5_error_code code, const char *fmt, va_list ap) __attribute__((format(printf Detailed Description Function Documentation KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_clear_error_message (krb5_context context) Clears the error message from the Kerberos 5 context. Parameters: context The Kerberos 5 context to clear KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_eai_to_heim_errno (int eai_errno, int system_error) Convert the getaddrinfo() error code to a Kerberos et error code. Parameters: eai_errno contains the error code from getaddrinfo(). system_error should have the value of errno after the failed getaddrinfo(). Returns: Kerberos error code representing the EAI errors. KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_h_errno_to_heim_errno (int eai_errno) Convert the gethostname() error code (h_error) to a Kerberos et error code. Parameters: eai_errno contains the error code from gethostname(). Returns: Kerberos error code representing the gethostname errors. KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_error_message (krb5_context context, krb5_error_code ret, const char * fmt, ...) Set the context full error string for a specific error code. The error that is stored should be internationalized. The if context is NULL, no error string is stored. Parameters: context Kerberos 5 context ret The error code fmt Error string for the error code ... printf(3) style parameters. KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarn (krb5_context context, krb5_error_code code, const char * fmt, va_list ap) Log a warning to the log, default stderr, include the error from the last failure. Parameters: context A Kerberos 5 context. code error code of the last error fmt message to print ap arguments Version 1.5.2 11 Jan 2012 Heimdal Kerberos 5 error reporting functions(3)
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy