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::TCLink(3pm)				User Contributed Perl Documentation				Vend::Payment::TCLink(3pm)

NAME
Vend::Payment::TCLink - Interchange TrustCommerce Support SYNOPSIS
&charge=trustcommerce or [charge mode=trustcommerce param1=value1 param2=value2] PREREQUISITES
Net::TCLink http://www.trustcommerce.com/tclink.html and CPAN both have this module, which actually does the bulk of the work. All that Vend::Payment::TCLink does is to massage the payment data between Interchange and Net::TCLink. DESCRIPTION
The Vend::Payment::TCLink module implements the trustcommerce() 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::TCLink 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 "trustcommerce". 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 trustcommerce 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=trustcommerce id=YourTrustCommerceID] or Route trustcommerce id YourTrustCommerceID or Variable TRUSTCOMMERCE_ID YourTrustCommerceID The active settings are: id Your TrustCommerce customer ID, supplied by TrustCommerce when you sign up. Global parameter is TRUSTCOMMERCE_ID. secret Your TrustCommerce customer password, supplied by TrustCommerce when you sign up. Global parameter is TRUSTCOMMERCE_SECRET. transaction The type of transaction to be run. Valid values are: Interchange TrustCommerce ---------------- ----------------- auth preauth return credit sale sale settle postauth Global parameter is TRUSTCOMMERCE_ACTION. avs Whether AVS (Address Verification System) is enabled. Valid values are "y" for enabled and "n" for disabled. Global parameter is TRUSTCOMMERCE_AVS. remap This remaps the form variable names to the ones needed by TrustCommerce. 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 TrustCommerce "demo" query paramter to TRUE. Examples: Route trustcommerce test TRUE or Variable TRUSTCOMMERCE_TEST TRUE or [charge mode=trustcommerce test=TRUE] Troubleshooting Try the instructions above, then enable test mode. A test order should complete. Disable test mode, then test in various TrustCommerce 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::TrustCommerce o Make sure Net::TCLink is installed and working. You can test to see whether your Perl thinks they are: perl -MNet::TCLink -e 'print "It works. "' If it "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, TrustCommerce consultants are available to help you out. See http://www.trustcommerce.com/contact.html for more information, or email developer@trustcommerce.com BUGS
There is actually nothing *in* Vend::Payment::TrustCommerce. It changes packages to Vend::Payment and places things there. AUTHORS
Dan Helfman <dan@trustcommerce.com>, based on code by Mark Stosberg <mark@summersault.com>, which was based on original code by Mike Heins. CREDITS
webmaster@nameastar.net Jeff Nappi <brage@cyberhighway.net> Paul Delys <paul@gi.alaska.edu> perl v5.14.2 2011-03-09 Vend::Payment::TCLink(3pm)
All times are GMT -4. The time now is 08:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy