[Za-pm] flat file test script
Walter Kruse
WKruse at multichoice.co.za
Tue Aug 12 06:58:21 CDT 2003
Hi everyone - hope someone will help a newbie
I need to simulate the importing of a flat file into two tables in a db for
test purposes. The file has very long records, which aren't separated into
fields by any character. Rather, the program under test counts characters.
So chars 1-8 go in table 1, chars 9-12 to table 2, chars 13-40 to table 1
again and so on. I want to use a perl script as the records are very long
(+/- 88 fields) to create two new text files and sort the records between
the two files as I specify. The problem, I am faced with, however, is the
counting and sorting of the chars. I don't have a clue. This is as far as I
got:
#!/usr/bin/perl
open (FILE, "testfile") || die "Can't open file !\n";
@file = <FILE>;
my($record) = split(/\n/, @file);
foreach $record (@file)
{
my($char) = split(//, $record);
}
close FILE;
Kind Regards
Walter Kruse
MultiChoice Information Technology
Software test analyst - Application Delivery and Support Team
Tel: +27 (0) 11 289-4552
Cell: +27 (0) 82 660 7288
Email: walterk at multichoice.co.za
Personal web page: http://www.ou-ryperd.net <http://www.ou-ryperd.net/>
**************************************************************************************************************************
Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to
the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically
be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or
copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile
or telephone and destroy the original message.
**************************************************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/za-pm/attachments/20030812/0dcc0308/attachment.htm
More information about the Za-pm
mailing list