Hello Mr. Clarkson,
When I run my code on the attached test data file, I get this.
[RESULT]
"
price: $825","beds: 3","baths: 1","
price: $825","phone: 214-821-2794","address: 2731 San Diego","location: Casa
View ","paper: The Dallas Morning News","date: 04/06/2004","
price: $800","beds: 3","baths: 1","
price: $800","phone: 214-502-9426","address: 2519 Bluffton","location: Casa
View ","paper: The Dallas Morning News","date: 04/05/2004","
price: $850","beds: 3","baths: 1","
price: $850","phone: 214-821-2794","address: 2731 San Diego","location: Casa
View ","paper: The Dallas Morning News","date: 04/05/2004","
price: $800","beds: 3","baths: 1","arrangement: 3bd/1ba/1 ","
price: $800","address: 11826 Strand","location: Casa View ","paper: The
Dallas Morning News","date: 04/04/2004","
price: $800","beds: 3","baths: 1","
price: $800","phone: 972-494-3178","address: 3178 or pgr","location: Casa
View ","paper: The Dallas Morning News","date: 04/04/2004","
price: $1195","beds: 3","baths: 2","
price: $1195","phone: 214-533-4554","address: 10622 Hermosa","location: Casa
View ","paper: The Dallas Morning News","date: 04/04/2004","
price: $975","beds: 4","baths: 2","
price: $975","phone: 469-569-0099","location: Casa View ","paper: The Dallas
Morning News","date: 04/04/2004",
[/RESULT]
My desired result is this, (I want to be able to import this data into
excel)
[DESIRED]
price: beds: bath: phone: address: location: paper: date:
data, data, data, data, data, data, data, data
[/DESIRED]
The problem is that I am getting duplicate matches with my regular
expressions and I am not getting the same fields on each record.
I would like to be able to import this data in excel from a csv text file.
HTH
William Martell
Thanks :)
----- Original Message -----
From: "Charles K. Clarkson" <[EMAIL PROTECTED]>
To: "'William Martell'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 08, 2004 2:58 PM
Subject: RE: Help with Variable Scope, Regular Expressions
> William Martell <[EMAIL PROTECTED]> wrote:
> :
> : I am trying to get this code to write the variables in
> : a specific order, even if they are undefined or blank.
> : I would like each row seperated by newline.
>
> What is a row? What specific order?
>
>
> : I am running into a problem with the scope of the
> : variable being limited to the block of code it is in.
> :
> : Can anyone help.
>
> [snipped useful code and data]
>
>
> It looks like you want to extract certain fields
> from certain lines of a text file. Once you have the
> correct fields, what are you going to do with them?
>
> Another way to ask the question might be: What
> data structure would be easiest for you to use when
> the field extraction from the text file is complete?
>
> Here's a three ad example using an Array of
> Hashes.
>
> (
> {
> price => 725,
> bedrooms => 3,
> bathrooms => 1,
> living_areas => undef,
> phone => '972-289-2098',
> address => undef,
> location => 'Mesquite',
> paper => 'The Dallas Morning News',
> date => '04/08/2004'
> },
> {
> price => 950,
> bedrooms => 3,
> bathrooms => 1,
> living_areas => undef,
> phone => '469-525-0204',
> address => '1620 Summitt',
> location => 'Mesquite',
> paper => 'The Dallas Morning News',
> date => '04/08/2004',
> },
> price => 1100,
> bedrooms => 4,
> bathrooms => 2,
> living_areas => 2,
> phone => '214-566-6106',
> location => 'Mesquite',
> paper => 'The Dallas Morning News',
> date => '04/08/2004',
> {
> )
>
> From this data structure I can sort on any field
> (or multiple fields). I can present only certain
> fields or do a search on a field.
>
> Don't worry about how we are going to convert the
> text file to this data structure just concentrate on
> what structure would be easiest for you to use and
> tell us what it looks like.
>
>
> HTH,
>
> Charles K. Clarkson
> --
> Mobile Homes Specialist
> 254 968-8328
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>