Interesting .. How do I handle this in Unix / Perl ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Interesting .. How do I handle this in Unix / Perl ?
# 1  
Old 10-11-2007
Interesting .. How do I handle this in Unix / Perl ?

This is how my input file is ( comma sepertated ):-

L,id,name,address,city,measure_id_1,measrure_id_qty_1,measure_id_2,measure_id_qty_2
D,123,vvc,wwwew wdwe,hou,zip,77057,tel,832
L,id,name,address,city,measure_id_1,measrure_id_qty_1
D,222,abc,dsdsd wwew wdwe,ny,zip,77057
L,id,city,measure_id_1,measrure_id_qty_1
D,333,dallas,state,tx

i.e It has lable record followed by the detail record, e.g for first set the id is 123, name is vvcm address is "wwwew wdwe"... however, measure_id_1 is "zip" and measrure_id_qty_1 is "77057" which means zip is 77057. similarily tel is 832.

Now the output I want is like this ...

id,name,address,city,zip,tel,state
123,vvc,wwwew wdwe,hou,77057,832,{NULL}
222,abc,dsdsd wwew wdwe,ny,77057,{NULL},{NULL}
333,{NULL},{NULL},dallas,{NULL},{NULL},tx

what seems to be interesting is I do not have to scan for column headers in L record only but I need to scan the detail records also for the column headers ....

If anyone knows the solution either in shell,awk, perl .. anything is welcome ..

Thanks ...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Interesting awk/Perl/sed parsing challenge

I have a log with entries like: out/target/product/imx53_smd/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/bindings/V8HTMLVideoElement.cpp : target thumb C++: libwebcore <=... (8 Replies)
Discussion started by: glev2005
8 Replies

2. Shell Programming and Scripting

Help needed on Perl Script to Handle Log files that are rotated using logrotate

Hello all, I am working on a perl script which will read weblogic logfile and send the error messages to Zenoss Monitoring tool. At present the script works and it can able to send the error messages to Zenoss. The problem comes when the logrotate has been applied to the weblogic log file. At... (3 Replies)
Discussion started by: kar_333
3 Replies

3. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

4. UNIX for Dummies Questions & Answers

Difference between handle to the thread HANDLE and thread identifier pthread_t

This question might be silly but its confusing me a bit: What is the difference between handle to the thread HANDLE and thread identifier pthread_t? ---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ---------- Sorry I saw details and HANDLE is in windows and... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

5. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

6. Solaris

Before I delete any file in Unix, How can I check no open file handle is pointing to that file?

I know how to check if any file has a unix process using a file by looking at 'lsof <fullpath/filename>' command. I think using lsof is very expensive. Also to make it accurate we need to inlcude fullpath of the file. Is there another command that can tell if a file has a truely active... (12 Replies)
Discussion started by: kchinnam
12 Replies

7. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

8. Shell Programming and Scripting

[PERL] Running unix commands within Perl Scripts

I understand that in order to run basic unix commands I would normally type at the prompt, I would have to use the following format system(ls -l); or exec(ls -l); But when I actually try to use the command, the script fails to compile and keeps telling me there is an error with this line. ... (1 Reply)
Discussion started by: userix
1 Replies

9. Shell Programming and Scripting

how to handle sql loader errors in unix

hi all, how to handle sql loader errors in unix shell ?? thanks in advance gemini (3 Replies)
Discussion started by: gemini106
3 Replies
Login or Register to Ask a Question
Business::OnlinePayment::TransactionCentral(3pm)	User Contributed Perl Documentation	  Business::OnlinePayment::TransactionCentral(3pm)

NAME
Business::OnlinePayment::TransactionCentral - Transaction Central backend module for Business::OnlinePayment SYNOPSIS
use Business::OnlinePayment; #### # One step transaction, the simple case. #### my $tx = new Business::OnlinePayment("TransactionCentral"); $tx->content( type => 'CC', login => '10011', #MerchantID password => 'KK48NPYEJHMAH6DK', #Regkey action => 'Normal Authorization', description => 'Business::OnlinePayment test', amount => '49.95', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', phone => '420-867-5309', email => 'tofu.beast@example.com', card_number => '4012000000001', expiration => '08/06', cvv2 => '1234', #optional ); $tx->submit(); if($tx->is_success()) { print "Card processed successfully: ".$tx->authorization." "; } else { print "Card was rejected: ".$tx->error_message." "; } =head1 DESCRIPTION This is a Business::OnlinePayment backend module for the Transaction Central (MerchantAnywhere, PRIMerchants) gateway. It is only useful if you have a merchant account with MerchantAnywhere / PRIMerchants: http://www.merchantanywhere.com/ http://www.merchantanywhere.com/ecshop/TC_elink.htm http://www.primerchants.com/ http://www.primerchants.com/info/transactioncentral.asp SUPPORTED TRANSACTION TYPES
CC, Visa, MasterCard, American Express, Discover Content required: type, login, password, action, amount, card_number, expiration, name, address, zip. ECHECK Content required: type, login, password, action, amount, account_number, routing_code, name PREREQUISITES
URI::Escape Net::SSLeay _or_ ( Crypt::SSLeay and LWP ) DESCRIPTION
For detailed information see Business::OnlinePayment. NOTE
The newest publicly available documentation is available at: http://www.merchantanywhere.com/ecshop/TC%20Interface%20NEW.pdf It is somewhat out-of-date and contains a few discrepancies. Google "TCInterfaceGuide" for current documentation. AUTHOR
Ivan Kohler <ivan-transactioncentral@420.am> COPYRIGHT AND LICENSE
Copyright (C) 2006 by Ivan Kohler Copyright (C) 2007 Freeside Internet Services, Inc. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perl(1). Business::OnlinePayment. perl v5.8.8 2008-02-27 Business::OnlinePayment::TransactionCentral(3pm)