LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] [OT] perl question...

[ILUG] [OT] perl question...

kevin lyda kevin+dated+1090334229.76b318 at ie.suberic.net
Thu Jul 15 15:37:00 IST 2004


On Thu, Jul 15, 2004 at 02:00:56PM +0100, Declan Grady wrote:
> @openitems[1]="d3_code    d3_ref     t d3_val     d3_date  d3_rate    f 
> d3_paid"
> @openitems[2]="========== ========== = ========== ======== ========== = 
> =========="

don't read in the headers.

> @openitems[3]="     10130       1509 A   53.07000 20030430    
> 1.00000      0.00000"
> @openitems[4]="     10130       1567 A   53.20000 20040611    
> 1.00000      0.00000"
> @openitems[5]="     10130     992820 1 4468.60000 20040628    
> 1.00000      0.00000"
> @openitems[6]="     10181     962652 A  100.99037 19970217    
> 1.00000      0.00000"
> @openitems[7]="     10224     992863 1  572.92000 20040701    
> 1.00000      0.00000"
> @openitems[8]="     10228          B E  -28.82664             1.00000 
> 0    0.00000"
> @openitems[9]="     10228     992779 1  693.10000 20040621    
> 1.00000      0.00000"

here either.

> @custname[3]="    10166 Customer Name A                   "
> @custname[4]="    10170 Customer Name B                   "
> @custname[5]="    10171 Customer Name C                   "
> @custname[6]="    10175 Customer Name D                   "
> @custname[7]="    10176 Customer Name E                   "
> @custname[8]="    10177 Customer Name F                   "
> @custname[9]="    10181 Customer Name G                   "
> @custname[10]="   10186 Customer Name H                   "

make sure the newline is stripped from all of the lines.

%custname = map {/^ *(\d+) (.*?) *$/; $1 => $2} @custname;
@expanded_outputitems
    = map {/^ *(\d+)/; ($custname{$1} || "NOT FOUND").  $_} @openitems;
print(join("\n", @expanded_outputitems));

kevin

-- 
american citizen?  register to vote: ~ florida voters - make sure you
https://register.votenet.com/LWV/    ~ haven't been struck from the
live overseas?  look here:           ~ voting lists.  check for your name
http://www.tellanamericantovote.com/ ~ here: http://tinyurl.com/2hbuj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.linux.ie/pipermail/ilug/attachments/20040715/ac96f879/attachment.pgp


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell