in reply to Database question: pulling a particular field from a flat database
why not something like this:
this is assuming a data file like:#!perl use strict; my $file = "foo.txt"; open (FH, "$file") || die ("unable to open the file!: $!"); my @ODB = <FH>; close (FH); my $line; foreach $line (@ODB) { my ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8)=s +plit('\|',$line); my ($field_data,$comment)=split(";",$field8); print "$field_data\n"; }
field1data|field2data|field3data|field4data|field5data|field6data|fiel +d7data|field8data1; comment goes here!
HTH
- f o o g o d --- ruining the bell curve for everyone else ---
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: Database question: pulling a particular field from a flat database
by tilly (Archbishop) on Sep 07, 2001 at 18:06 UTC | |
by foogod (Friar) on Sep 08, 2001 at 00:37 UTC |