RE: Compare to a list
- From: "Wagner, David --- Senior Programmer Analyst --- WGO"
- Date: Thu, 28 Apr 2005 09:11:56 -0700
Dan Litsky wrote:
> I have a group of files that are sent to me every month and I'd like
> to write a quick Perl script to check to make sure that all of the
> fields are coming in. I wrote a Perl script to dump out all the
> field names (it dumps out all the headers which are the field names)
> and I've made sure it's complete. Now I want to run through the new
> files coming in, match the headers in those files to my list and
> print any fields that are in the list but not in the files cominng
> in. The list has two fields in it -- the name of the file in field1
> and the names of the fields in field2. I'm looking for some help in
> just a general, what is the best way to approach this type of thing.
> I can put the complete list of fields in Excel and read from that or
> I guess I can read the list into a Perl array but then I need to go
> through all of the files, match to the filename in the list and then
> look for the fields in each file.
Use the filname portion ( or whatever is necessary to make unique ) and place in a hash along with column information. I have done this for use in comparing one system(ie, Production against QA ) for DB2 for Tables and Indexes. I place the column infomation as anonymous arraysusing the column number as my index into the array. I use the index 0 for a count of the columns.
Wags ;)
>
> Dan
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************
.
- Prev by Date: Re: if else question
- Next by Date: RE: if else question
- Previous by thread: Re: Compare to a list
- Next by thread: if else question
- Index(es):
Relevant Pages
|