Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE : Problems matching or parsing with delimiters in text

> -----Message d'origine-----
> De=A0: KEVIN ZEMBOWER [mailto:KZEMBOWE@jhuccp.org]
> Envoy=E9=A0: lundi 28 mars 2005 18:13
> =C0=A0: beginners@perl.org
> Objet=A0: Problems matching or parsing with delimiters in text
>=20
> I'm trying to read in text lines from a file that look like this:
> "B-B01","Eng","Binder for Complete Set of Population Reports",13,0
> "C-CD01","Eng","The Condoms CD-ROM",12,1
> "F-J41a","Fre",,13,1
> "F-J41a","SPA",,13,1
> "M-FC01","Eng","Africa Flip Charts- Planning Your Family (E,F,
> Swahili)(12""x9"")",7,1
> "M-FC01","Fre","Africa Flip Charts- Planning Your Family (E,F,
> Swahili)(12""x9"")",7,1
>=20
> The first two lines are typical of most of the file. The second two
have a
> blank third field and the last two show embedded commas and escaped
double
> quotes in the third field. This is an output of another program, but I
can
> filter it and make substitutions if that makes anything easier.
>=20
> I'm trying to parse it with these statements:
> while (<> ) { # While there are more records in the inventory export
file

I heven't read the complete post but ;)
your file seems to have a well known format called
CSV (Comma Separated Value).
You don't need to reinvent the wheel writing yourself a parser
for such files, since proven solutions (modules) already exist
doing it for you.

Have a look to CPAN (http://search.cpan.org) search for Text::CVS.

Text::CVS::Simple seems interesting=20
http://search.cpan.org/~tmtm/Text-CSV-Simple-0.20/

Install and try ...

HTH,
Jos=E9.




Report this thread to moderator Post Follow-up to this message
Old Post
Jose Nyimi
03-28-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:52 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.