Sponsored Content
Top Forums Shell Programming and Scripting Fixed with file- removing leading zeros and adding the space Post 302936431 by RudiC on Wednesday 25th of February 2015 11:29:27 AM
Old 02-25-2015
Where have all the spaces gone, ...? I guess they're missing due to not using code tags.
Try
Code:
awk '{$5=sprintf("%9d", $5)} 1' file
1ABC 1111 2222 3333     12341 1001
2ABC 1111 2222 3333     12342 1002
3ABC 1111 2222 3333    112343 1003
1DEF 5555 4444 9696     12344 1004
2DEF 5555 2323 8686     12345 1005
3DEF 5555 1212 7676     12346 1006

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

truncating leading zeros of a column in a file

Hi I have a file in which I have 5 columns which are delimited by “|” as shown ABC|12|YAK|METRIC|000000019.5 XYZ|10|ABX|META|000000002.5 Now my requirement is to take the last column trim the leading zero's for that column values and write back to the same file in the same... (7 Replies)
Discussion started by: nvuradi
7 Replies

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

3. Shell Programming and Scripting

Adding Leading Zero with Right Justified and Removing Duplicates

hello everyone. I'm hoping someone can help me out here. I have 2 files. It looks like this: File 1: abc1, defg, 50.00, mno,990 abc2, cats, 100.00, pops,991 abc3, dogs, 1.00, treat,992 File 2: 990, airplanes, runway, doctor 991, jets, birds, much 990,... (13 Replies)
Discussion started by: crazyhpux
13 Replies

4. Shell Programming and Scripting

Help with adding leading zeros to a filename

Hi i need help in adding leading zero to filenames e.g file name in my folder are 1_234sd.txt 23_234sd.txt the output i need is 001_234sd.txt 023_234sd.txt can i do this shell scripting please help (2 Replies)
Discussion started by: rsmpk
2 Replies

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

6. UNIX for Dummies Questions & Answers

Add leading zeros to columns in a file

Hello Gurus, Quick question. I have a file with the following records: A~000000000000518000~SLP ~99991231~20090701~88.50~USD~CS~ A~000000000000518000~SLP ~99991231~20090701~102.00~USD~CS~ A~000000000000772000~SLP ~99991231~20100701~118.08~USD~CS~ I wold like to do the following: 1. Add... (1 Reply)
Discussion started by: chumsky
1 Replies

7. Shell Programming and Scripting

Help deleting leading zeros in a file

I have a list of numbers extracted and need to delete the leading zeros from them, but when i do so, the command I am using also deletes numbers that end in Zero as well. eg 10, 20, 30, etc this is part of a larger script and the only way I can think of is to try and detect the 10,20 30 etc in... (19 Replies)
Discussion started by: kcpoole
19 Replies

8. Shell Programming and Scripting

Adding Leading Zeros for date in a file

Hello, I have a pipe separated file with two major lines. One is header and another is detail line. Header starts with H and Detail start with D. Sample Content: H|123456|Joes Watson|UK|4/5/2016|12/5/2016|3456|HC|NW|||||| D|123456|Joes... (13 Replies)
Discussion started by: Mannu2525
13 Replies

9. UNIX for Beginners Questions & Answers

How do I remove leading spaces in UNIX when count of space character is not fixed? Example below-

Script showStreamsGLIS$reg.$env.ksh gives me output as below- Job Stime Etime Status ExitCode GLIS-AS-S-EFL-LOCK-B ----- ----- OI 103313880/0 GLIS-ALL-Q-EOD-FX-UPDT-1730-B ----- ----- TE 0/0 GLIS-TK-S-BWSOD-B ... (8 Replies)
Discussion started by: Tanu
8 Replies

10. Shell Programming and Scripting

Ho to remove leading zeros from a csv file which is sent from a UNIX script

Hi All, I am using a informatica job to create a csv file and a unix script the mail the generated file.Everything is working fine but I am not seeing leading zeros in the csv file sent in the mail.These zeros were present when the .csv file was generated by informatica procees. Is there any... (11 Replies)
Discussion started by: karthik adiga
11 Replies
Vend::Payment::AuthorizeNet(3pm)			User Contributed Perl Documentation			  Vend::Payment::AuthorizeNet(3pm)

NAME
Vend::Payment::AuthorizeNet - Interchange AuthorizeNet Support SYNOPSIS
&charge=authorizenet or [charge mode=authorizenet param1=value1 param2=value2] PREREQUISITES
Net::SSLeay or LWP::UserAgent and Crypt::SSLeay Only one of these need be present and working. DESCRIPTION
The Vend::Payment::AuthorizeNet module implements the authorizenet() routine for use with Interchange. It is compatible on a call level with the other Interchange payment modules. To enable this module, place this directive in "interchange.cfg": Require module Vend::Payment::AuthorizeNet This must be in interchange.cfg or a file included from it. Make sure CreditCardAuto is off (default in Interchange demos). The mode can be named anything, but the "gateway" parameter must be set to "authorizenet". To make it the default payment gateway for all credit card transactions in a specific catalog, you can set in "catalog.cfg": Variable MV_PAYMENT_MODE authorizenet It uses several of the standard settings from Interchange payment. Any time we speak of a setting, it is obtained either first from the tag/call options, then from an Interchange order Route named for the mode, then finally a default global payment variable, For example, the "id" parameter would be specified by: [charge mode=authorizenet id=YourAuthorizeNetID] or Route authorizenet id YourAuthorizeNetID or Variable MV_PAYMENT_ID YourAuthorizeNetID The active settings are: id Your Authorize.net account ID, supplied by Authorize.net when you sign up. Global parameter is MV_PAYMENT_ID. secret Your Authorize.net account password, supplied by Authorize.net when you sign up. Global parameter is MV_PAYMENT_SECRET. This may not be needed for actual charges. referer A valid referering url (match this with your setting on secure.authorize.net). Global parameter is MV_PAYMENT_REFERER. transaction The type of transaction to be run. Valid values are: Interchange AuthorizeNet ---------------- ----------------- auth AUTH_ONLY return CREDIT reverse PRIOR_AUTH_CAPTURE sale AUTH_CAPTURE settle CAPTURE_ONLY void VOID remap This remaps the form variable names to the ones needed by Authorize.net. See the "Payment Settings" heading in the Interchange documentation for use. test Set this to "TRUE" if you wish to operate in test mode, i.e. set the Authorize.net "x_Test_Request" query parameter to TRUE. Examples: Route authorizenet test TRUE or Variable MV_PAYMENT_TEST TRUE or [charge mode=authorizenet test=TRUE] Troubleshooting Try the instructions above, then enable test mode. A test order should complete. Disable test mode, then test in various Authorize.net error modes by using the credit card number 4222 2222 2222 2222. Then try a sale with the card number "4111 1111 1111 1111" and a valid expiration date. The sale should be denied, and the reason should be in [data session payment_error]. If nothing works: o Make sure you "Require"d the module in interchange.cfg: Require module Vend::Payment::AuthorizeNet o Make sure either Net::SSLeay or Crypt::SSLeay and LWP::UserAgent are installed and working. You can test to see whether your Perl thinks they are: perl -MNet::SSLeay -e 'print "It works "' or perl -MLWP::UserAgent -MCrypt::SSLeay -e 'print "It works "' If either one prints "It works." and returns to the prompt you should be OK (presuming they are in working order otherwise). o Check the error logs, both catalog and global. o Make sure you set your payment parameters properly. o Try an order, then put this code in a page: <XMP> [calc] my $string = $Tag->uneval( { ref => $Session->{payment_result} }); $string =~ s/{/{ /; $string =~ s/,/, /g; return $string; [/calc] </XMP> That should show what happened. o If all else fails, consultants are available to help with integration for a fee. See http://www.icdevgroup.org/ for mailing lists and other information. BUGS
There is actually nothing *in* Vend::Payment::AuthorizeNet. It changes packages to Vend::Payment and places things there. AUTHORS
Mark Stosberg <mark@summersault.com>. Based on original code by Mike Heins <mike@perusion.com>. CREDITS
Jeff Nappi <brage@cyberhighway.net> Paul Delys <paul@gi.alaska.edu> webmaster@nameastar.net Ray Desjardins <ray@dfwmicrotech.com> Nelson H. Ferrari <nferrari@ccsc.com> perl v5.14.2 2011-05-02 Vend::Payment::AuthorizeNet(3pm)
All times are GMT -4. The time now is 12:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy