ok I wrote a perl script that parses our credit card files. In a nutshell it:
1. Reads a directory listing and pushing all files into the array
@dirlisting
2. go through foreach(@dirlisting) opens the file and substr it getting the data I want out of it and writing it to a new file. Removing any dupes if the dupes are in a certain field:
$lines{$ccn}++;
if($lines{$ccn} == 2){
push @dupes, $ccn;
3. Then we take out dupes array and write that to a dupes file and if they're not dupes:
if (!$dupez{$ccn}){ then we write to a newmaster.txt file.
Now everything seems to work ok but it was just reported to me that one of the credit card numbers in the original file was reversed! ie.
Original File:
firstnumber
secondnumber
After PerlScript:
secondnumber
firstnumber
Now the reason this is a problem is cause we substr the entire line so the other fields that corresponde with those numbers were not switch! so I have mismatched number. Any ideas as to why this might happen?
Thanks for any help
Edit kudra,
2002-02-23
Added description to title
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.