perldoc perlretut
You can use split on the comma character to get the individual fields in list context (store to an array or hash for example) and then step through the list searching on each. Or possibly a better approach if your data will allow it, search on the whole line and then only split if need be, this may help speed things up. There are also modules that will work on plain text files in a similar manner to a database without you having to do the handling. Check out CPAN (http://search.cpan.org)
Particularly: http://search.cpan.org/author/JZUCKER/DBD-CSV-0.2002/lib/DBD/CSV.pm
http://danconia.org
Albert L. Lukaszewski wrote:
I am developing a search engine for a database I use. The database is static and consists of comma delimited files. After reading the text line-by-line into a scalar, I would like to analyze the data by field. How could I separate the fields or, at least, analyze them separately against a search string? An example of a line from the database is below (before you ask, it is a grammatical database of Aramaic):4Q196.1.1, )rw#, n-mse, n.reg., <rw# wall/fortification/stronghold Any and all help very much appreciated. Yours, Al Lukaszewski St Andrews, Scotland
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
