Data parsing query

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Data parsing query

Stephen Wonfor-3
Hi

A Filemaker 11 solution - heading to 16 or next when client approves (don’t ask!).
We have a webviewer on a layout that the user selects all the text in then pastes it into a global field.
The data resembles a CSV file with comma delimiters.  Some of the data fields - between the delimiters - are quote enclosed and some are not.
My standard parsing dance would be to turn all the commas into line feeds then use GetValue to grab data from various rows in the stack then write that into the right field.
Clearly, a comma in data between a pair of quotes will break this.  I can think of a number of awkward ways to deal with this - stack the data anyway then loop through looking for rows in the stack with unpaired quotes and then gluing the dat back together seems most likely at the moment.

Might there be a better way?

Stephen

---

"Femme nest" - a great closed captioning misinterpretation.  See also: "The Arch Boyfriend of Canterbury"

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Data parsing query

Beverly Voth-3
Interesting! When I copy a table of data, I believe I get tab-delimited text. I might be incorrect, but you might test to this.

Sent from miPhone

> On May 1, 2017, at 10:46 AM, Stephen Wonfor <[hidden email]> wrote:
>
> Hi
>
> A Filemaker 11 solution - heading to 16 or next when client approves (don’t ask!).
> We have a webviewer on a layout that the user selects all the text in then pastes it into a global field.
> The data resembles a CSV file with comma delimiters.  Some of the data fields - between the delimiters - are quote enclosed and some are not.
> My standard parsing dance would be to turn all the commas into line feeds then use GetValue to grab data from various rows in the stack then write that into the right field.
> Clearly, a comma in data between a pair of quotes will break this.  I can think of a number of awkward ways to deal with this - stack the data anyway then loop through looking for rows in the stack with unpaired quotes and then gluing the dat back together seems most likely at the moment.
>
> Might there be a better way?
>
> Stephen
>
> ---
>
> "Femme nest" - a great closed captioning misinterpretation.  See also: "The Arch Boyfriend of Canterbury"
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Data parsing query

Ben Levitan LLC
In reply to this post by Stephen Wonfor-3
Why parse everything.  Where's the data you are trying to extract.  I've got a custom function called "Get_Between" with two parameters when I do these type of things.  For example, I'm trying to get the first name out of the webviewer and the data looks like this:






<a href="nonMember.do?id=1493650770636&index=0&page=1 first_name>Daniel</a>,







The custom function would be "Get_Between(BigField; "first_name>"; "</a>")


The results is Daniel.


The customer function uses the "Middle" function and also "Position" functions in FMA 11



Ben Levitan
sent from my IBM Selectric Typewriter
____________________________________________________






-----Original Message-----
From: Stephen Wonfor <[hidden email]>
To: FMX Experts <[hidden email]>
Sent: Mon, May 1, 2017 10:46 am
Subject: Data parsing query

HiA Filemaker 11 solution - heading to 16 or next when client approves (don’t ask!).We have a webviewer on a layout that the user selects all the text in then pastes it into a global field.The data resembles a CSV file with comma delimiters.  Some of the data fields - between the delimiters - are quote enclosed and some are not.My standard parsing dance would be to turn all the commas into line feeds then use GetValue to grab data from various rows in the stack then write that into the right field.Clearly, a comma in data between a pair of quotes will break this.  I can think of a number of awkward ways to deal with this - stack the data anyway then loop through looking for rows in the stack with unpaired quotes and then gluing the dat back together seems most likely at the moment.Might there be a better way?Stephen---"Femme nest" - a great closed captioning misinterpretation.  See also: "The Arch Boyfriend of Canterbury"_______________________________________________FMPexperts mailing [hidden email]://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Data parsing query

Stephen Wonfor-3
In reply to this post by Beverly Voth-3
Beverly

eg.
header,69,,,,common,10.45,0.00,0.50,2017-04-10,,"123 Street",,Calgary,AB,CA,T3K6C1,"123 Street",,Calgary,AB,CA,T3K6C1,”Stephen Wonfor”,[hidden email],4034541630,,xx4,

Stephen

----------

"There are 10^11 stars in the galaxy. That used to be a huge number. But it's only a hundred billion. It's less than the national deficit! We used to call them astronomical numbers. Now we should call them economical numbers." ---Richard Feynman, physicist, Nobel laureate

> On May 1, 2017, at 9:03 AM, Beverly Voth <[hidden email]> wrote:
>
> Interesting! When I copy a table of data, I believe I get tab-delimited text. I might be incorrect, but you might test to this.
>
> Sent from miPhone
>
>> On May 1, 2017, at 10:46 AM, Stephen Wonfor <[hidden email]> wrote:
>>
>> Hi
>>
>> A Filemaker 11 solution - heading to 16 or next when client approves (don’t ask!).
>> We have a webviewer on a layout that the user selects all the text in then pastes it into a global field.
>> The data resembles a CSV file with comma delimiters.  Some of the data fields - between the delimiters - are quote enclosed and some are not.
>> My standard parsing dance would be to turn all the commas into line feeds then use GetValue to grab data from various rows in the stack then write that into the right field.
>> Clearly, a comma in data between a pair of quotes will break this.  I can think of a number of awkward ways to deal with this - stack the data anyway then loop through looking for rows in the stack with unpaired quotes and then gluing the dat back together seems most likely at the moment.
>>
>> Might there be a better way?
>>
>> Stephen
>>
>> ---
>>
>> "Femme nest" - a great closed captioning misinterpretation.  See also: "The Arch Boyfriend of Canterbury"
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Data parsing query

Beverly Voth-3
Comma-separated it is with quotes only around phrases (words are spaced).

Test some more, but if that's the case, I might go a couple different routes:
* add quotes where none exist
Or
* change spaces to something "odd", remove quotes, change comma to tab... ???

Sent from miPhone

> On May 1, 2017, at 11:08 AM, Stephen Wonfor <[hidden email]> wrote:
>
> Beverly
>
> eg.
> header,69,,,,common,10.45,0.00,0.50,2017-04-10,,"123 Street",,Calgary,AB,CA,T3K6C1,"123 Street",,Calgary,AB,CA,T3K6C1,”Stephen Wonfor”,[hidden email],4034541630,,xx4,
>
> Stephen
>
> ----------
>
> "There are 10^11 stars in the galaxy. That used to be a huge number. But it's only a hundred billion. It's less than the national deficit! We used to call them astronomical numbers. Now we should call them economical numbers." ---Richard Feynman, physicist, Nobel laureate
>
>> On May 1, 2017, at 9:03 AM, Beverly Voth <[hidden email]> wrote:
>>
>> Interesting! When I copy a table of data, I believe I get tab-delimited text. I might be incorrect, but you might test to this.
>>
>> Sent from miPhone
>>
>>> On May 1, 2017, at 10:46 AM, Stephen Wonfor <[hidden email]> wrote:
>>>
>>> Hi
>>>
>>> A Filemaker 11 solution - heading to 16 or next when client approves (don’t ask!).
>>> We have a webviewer on a layout that the user selects all the text in then pastes it into a global field.
>>> The data resembles a CSV file with comma delimiters.  Some of the data fields - between the delimiters - are quote enclosed and some are not.
>>> My standard parsing dance would be to turn all the commas into line feeds then use GetValue to grab data from various rows in the stack then write that into the right field.
>>> Clearly, a comma in data between a pair of quotes will break this.  I can think of a number of awkward ways to deal with this - stack the data anyway then loop through looking for rows in the stack with unpaired quotes and then gluing the dat back together seems most likely at the moment.
>>>
>>> Might there be a better way?
>>>
>>> Stephen
>>>
>>> ---
>>>
>>> "Femme nest" - a great closed captioning misinterpretation.  See also: "The Arch Boyfriend of Canterbury"
>>>
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Data parsing query

Richard DeShong
The FM Import knows how to deal with csv data, so you could create an
"import" table with fields that match the data structure, then export
the data to a temp file, and then import it into the Import table.


On 5/1/2017 8:25 AM, Beverly Voth wrote:

> Comma-separated it is with quotes only around phrases (words are spaced).
>
> Test some more, but if that's the case, I might go a couple different routes:
> * add quotes where none exist
> Or
> * change spaces to something "odd", remove quotes, change comma to tab... ???
>
> Sent from miPhone
>
>> On May 1, 2017, at 11:08 AM, Stephen Wonfor <[hidden email]> wrote:
>>
>> Beverly
>>
>> eg.
>> header,69,,,,common,10.45,0.00,0.50,2017-04-10,,"123 Street",,Calgary,AB,CA,T3K6C1,"123 Street",,Calgary,AB,CA,T3K6C1,”Stephen Wonfor”,[hidden email],4034541630,,xx4,
>>
>> Stephen
>>
>> ----------
>>
>> "There are 10^11 stars in the galaxy. That used to be a huge number. But it's only a hundred billion. It's less than the national deficit! We used to call them astronomical numbers. Now we should call them economical numbers." ---Richard Feynman, physicist, Nobel laureate
>>
>>> On May 1, 2017, at 9:03 AM, Beverly Voth <[hidden email]> wrote:
>>>
>>> Interesting! When I copy a table of data, I believe I get tab-delimited text. I might be incorrect, but you might test to this.
>>>
>>> Sent from miPhone
>>>
>>>> On May 1, 2017, at 10:46 AM, Stephen Wonfor <[hidden email]> wrote:
>>>>
>>>> Hi
>>>>
>>>> A Filemaker 11 solution - heading to 16 or next when client approves (don’t ask!).
>>>> We have a webviewer on a layout that the user selects all the text in then pastes it into a global field.
>>>> The data resembles a CSV file with comma delimiters.  Some of the data fields - between the delimiters - are quote enclosed and some are not.
>>>> My standard parsing dance would be to turn all the commas into line feeds then use GetValue to grab data from various rows in the stack then write that into the right field.
>>>> Clearly, a comma in data between a pair of quotes will break this.  I can think of a number of awkward ways to deal with this - stack the data anyway then loop through looking for rows in the stack with unpaired quotes and then gluing the dat back together seems most likely at the moment.
>>>>
>>>> Might there be a better way?
>>>>
>>>> Stephen
>>>>
>>>> ---
>>>>
>>>> "Femme nest" - a great closed captioning misinterpretation.  See also: "The Arch Boyfriend of Canterbury"
>>>>
>>>> _______________________________________________
>>>> FMPexperts mailing list
>>>> [hidden email]
>>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

--
Richard DeShong
Logic Tools
510-642-5123 office
925-285-1088 cell

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au