Sponsored Content
Top Forums Shell Programming and Scripting Converting vertical items into Horizontal plz Post 302342632 by durden_tyler on Monday 10th of August 2009 10:44:56 AM
Old 08-10-2009
Quote:
Originally Posted by dprakash
...
can anybody give me the alternate solution so that it can apply for n no of numbers (ex 10000 numbers) and remove the comman at the end..
...
One way of doing it with Perl:

Code:
$
$ cat f1
1111
2222
3333
4444
$
$ perl -ne 'chomp; push @x,$_; END {print join ",", @x; print "\n"}' f1
1111,2222,3333,4444
$
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

converting horizontal line to vertical line

how to use "tr" command to display horizontal line to vertical line for vertical to horizontal, the command is tr '\n' '\t' <inputfile but what is the command for horizontal to vertical Thanks Vasikaran (3 Replies)
Discussion started by: vasikaran
3 Replies

2. Shell Programming and Scripting

Converting Horizontal items into vertical plz

i have one scenario i want to convert horizontal rows into vertical rows. For eg Input file contains: 1001,34.7,43.7,34.99|1002,34,243,34|1003,34,43,34|1004,34,43,34|1005,34,43,34 Output file contains 1001,34.7,43.7,34.99 1002,34,243,34 1003,34,43,34 1004,34,43,34 1005,34,43,34 Here... (3 Replies)
Discussion started by: dprakash
3 Replies

3. Shell Programming and Scripting

combine files in horizontal way, not vertical.

Hi Everyone, I have three files. FileA: aaaa aaaa bb ccc FileB: 21 2 FileC: eeeeeee e eee ee Would like to combine three of them, not like cat, to cat three files, but the output should be like: (3 Replies)
Discussion started by: jimmy_y
3 Replies

4. UNIX for Dummies Questions & Answers

Horizontal to vertical

Hi, Silly question, if I have an excel file that looks something like this: ................. Subject 1 Subject 2 Subject 3 Subject 4 Fever..............13...........9.............23..........14 Headache.........2............12...........18..........23... (3 Replies)
Discussion started by: Xterra
3 Replies

5. UNIX for Dummies Questions & Answers

vertical to horizontal

dear all, i'm new to unix and i try to figure out the best case for making list of vertical text to become horizontal and skip the line 1 and 2. example text : Data DATE XXXXX MAX 47 53 49 51 48 48 7 46 51 8 25 (6 Replies)
Discussion started by: andrisetia
6 Replies

6. Shell Programming and Scripting

Vertical And Horizontal Pivoting

Hi All, My Input data is: A=1 B=2 My desired Output should be: A|B 1|2 Thanks in advance... (3 Replies)
Discussion started by: kmsekhar
3 Replies

7. Shell Programming and Scripting

How do i do the vertical to horizontal??

51009 8746 8912 17986 20315 24998 5368 38934 7805 8566 (4 Replies)
Discussion started by: nikhil jain
4 Replies

8. Shell Programming and Scripting

Help! output format from vertical to horizontal

Hi All, please help to achieve the desired output Example: I have a file which contains the below data empname robert empid 787 design consultant empname alex empid 898 design advocate Desired output should be empname empid design robert 787 consultant (19 Replies)
Discussion started by: rocky2013
19 Replies

9. UNIX for Dummies Questions & Answers

Change Vertical to Horizontal

I need to change data from vertical to horizontal but with condition input USA|80 AUS|40 BRA|33 VEGAS|40 KENTUCKY|50 NEWYORK|21 DARWIN|33 ADELAIDE|21 SAOPAOLO|44 RIO|89 GAPIZA|44 BENFLEX|32 AXIS|44 ACRE|56 HEIGHT|22 (5 Replies)
Discussion started by: radius
5 Replies

10. UNIX for Dummies Questions & Answers

Print vertical to horizontal

Hi Masters, I need help to change my vertical data to horisontal input 2015-04-13|JS|741667 2015-04-13|JSJ|2272 2015-04-13|TMS|107099 2015-04-12|JMD|47945 2015-04-13|TM|760024 2015-04-13|JM|484508 2015-04-14|JMJ|318 2015-04-14|JSD|54436 2015-04-13|JM|15410 Output... (2 Replies)
Discussion started by: radius
2 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 03:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy