Jack Daniels (Butch) <[EMAIL PROTECTED]> wrote:
> Have spent the last couple hours searching Internet, reading 
> my perl books, but I just can't figure it out.
> 
> Problem:
> Our barcodes are 14 digits, however not all employees have a 
> scanner when associating the barcode with an item.
> Barcodes are then manually entered and are not always entered 
> correctly.
> 
> I would like to extract all barcodes that are not 14 digits 
> from a file of all the barcodes in the system so we can correct them.
> Some barcodes for whatever reason were entered with a dash. 
> Not good In the meantime, I'll keep looking for a solution 
> the hard way, Internet.

This would be much easier of we had some sample data.

Assuing that your data is indeed a plain text file with
one number per line, then the obvious solution would be
to read it line by line and see wether each line is
a valid barcode by matching it to /^\d{14}$/.

HTH,
Thomas

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to