setting itemdel

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

setting itemdel

Eva Isotalo-2
MC 2.4.3

How do I "catch" the different parts of a file that has columns like this?:
1 Rose Floral Wax: (Size: 25g; ) FW07-25 £3.65 £3.65
1 Jasmine Grandaflorum Floral Wax (Size: 25g; ) FW03-25 £2.95 £2.95
1 Mimosa Floral Wax (Size: 25g; ) FW05-25 £2.95 £2.95
 
I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.

Eva

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

xtalkprogrammer
Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

> MC 2.4.3
>
> How do I "catch" the different parts of a file that has columns like this?:
> 1 Rose Floral Wax: (Size: 25g; ) FW07-25 £3.65 £3.65
> 1 Jasmine Grandaflorum Floral Wax (Size: 25g; ) FW03-25 £2.95 £2.95
> 1 Mimosa Floral Wax (Size: 25g; ) FW05-25 £2.95 £2.95
>
>
> I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.
>
> Eva



_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Michael Kann
Eva and Mark,

Here's a quirk way to group the products:

set the itemDel to tab
put fld 1 into v  --- list of invoices
sort lines of v by item 2 of each
put v into fld 2 -- products will be grouped together



--- On Sat, 5/7/11, Mark Schonewille <[hidden email]> wrote:

From: Mark Schonewille <[hidden email]>
Subject: Re: setting itemdel
To: "Discussions on Metacard" <[hidden email]>
Date: Saturday, May 7, 2011, 9:06 AM

Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

> MC 2.4.3
>
> How do I "catch" the different parts of a file that has columns like this?:
> 1     Rose Floral Wax: (Size: 25g; )     FW07-25     £3.65     £3.65
> 1     Jasmine Grandaflorum Floral Wax (Size: 25g; )     FW03-25     £2.95     £2.95
> 1     Mimosa Floral Wax (Size: 25g; )     FW05-25     £2.95     £2.95
>
>
> I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.
>
> Eva



_______________________________________________
metacard mailing list
metacard@...
http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Michael Kann
In reply to this post by xtalkprogrammer
Eva,

I just realized you posted on the metacard list. You might want to also check out the
LiveCode list also. It is the more recent version of the metacard list.

Here it is:

How to use LiveCode" <[hidden email]>

--- On Sat, 5/7/11, Mark Schonewille <[hidden email]> wrote:

From: Mark Schonewille <[hidden email]>
Subject: Re: setting itemdel
To: "Discussions on Metacard" <[hidden email]>
Date: Saturday, May 7, 2011, 9:06 AM

Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

> MC 2.4.3
>
> How do I "catch" the different parts of a file that has columns like this?:
> 1     Rose Floral Wax: (Size: 25g; )     FW07-25     £3.65     £3.65
> 1     Jasmine Grandaflorum Floral Wax (Size: 25g; )     FW03-25     £2.95     £2.95
> 1     Mimosa Floral Wax (Size: 25g; )     FW05-25     £2.95     £2.95
>
>
> I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.
>
> Eva



_______________________________________________
metacard mailing list
metacard@...
http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Eva Isotalo-2
Thank you guys!
I had placed the itemdel 'tab' in quotes, that's why it didn't work. Sigh...
Works fine now.
And thanks for the great "quirky" suggestion. :)

Eva


On 2011-05-07 16:44, Michael Kann wrote:
Eva,

I just realized you posted on the metacard list. You might want to also check out the
LiveCode list also. It is the more recent version of the metacard list.

Here it is:

How to use LiveCode" [hidden email]

--- On Sat, 5/7/11, Mark Schonewille [hidden email] wrote:

From: Mark Schonewille [hidden email]
Subject: Re: setting itemdel
To: "Discussions on Metacard" [hidden email]
Date: Saturday, May 7, 2011, 9:06 AM

Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

> MC 2.4.3
>
> How do I "catch" the different parts of a file that has columns like this?:
> 1     Rose Floral Wax: (Size: 25g; )     FW07-25     £3.65     £3.65
> 1     Jasmine Grandaflorum Floral Wax (Size: 25g; )     FW03-25     £2.95     £2.95
> 1     Mimosa Floral Wax (Size: 25g; )     FW05-25     £2.95     £2.95
>
>
> I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.
>
> Eva



_______________________________________________
metacard mailing list
metacard@...
http://lists.runrev.com/mailman/listinfo/metacard
_______________________________________________ metacard mailing list [hidden email] http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Eva Isotalo-2
In reply to this post by xtalkprogrammer
Ok, a continuation. On lines like the following I'd like to be able to catch and delete the '(Size: 100ml;)' but keep the '100'. How would I go about doing this?

1     Benzoin (Mobile) Siam (Size: 100ml; )     EO16-100     £7.55

Eva


On 2011-05-07 16:06, Mark Schonewille wrote:
Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

MC 2.4.3

How do I "catch" the different parts of a file that has columns like this?:
1 	Rose Floral Wax: (Size: 25g; ) 	FW07-25 	£3.65 	£3.65
1 	Jasmine Grandaflorum Floral Wax (Size: 25g; ) 	FW03-25 	£2.95 	£2.95
1 	Mimosa Floral Wax (Size: 25g; ) 	FW05-25 	£2.95 	£2.95


I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.

Eva


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Eva Isotalo-2
Solved it. Not pretty but works. :)

Eva

On 2011-05-07 18:38, Eva Isotalo wrote:
Ok, a continuation. On lines like the following I'd like to be able to catch and delete the '(Size: 100ml;)' but keep the '100'. How would I go about doing this?

1     Benzoin (Mobile) Siam (Size: 100ml; )     EO16-100     £7.55

Eva


On 2011-05-07 16:06, Mark Schonewille wrote:
Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

MC 2.4.3

How do I "catch" the different parts of a file that has columns like this?:
1 	Rose Floral Wax: (Size: 25g; ) 	FW07-25 	£3.65 	£3.65
1 	Jasmine Grandaflorum Floral Wax (Size: 25g; ) 	FW03-25 	£2.95 	£2.95
1 	Mimosa Floral Wax (Size: 25g; ) 	FW05-25 	£2.95 	£2.95


I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.

Eva

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Michael Kann
In reply to this post by Eva Isotalo-2
Eva, I meant to type "quick", but "quirky" would probably best describe my programming suggestions. Don't hesitate to ask if you need some fresh eyes to help out.

--- On Sat, 5/7/11, Eva Isotalo <[hidden email]> wrote:

From: Eva Isotalo <[hidden email]>
Subject: Re: setting itemdel
To: "Discussions on Metacard" <[hidden email]>
Date: Saturday, May 7, 2011, 10:01 AM

Thank you guys!
I had placed the itemdel 'tab' in quotes, that's why it didn't work. Sigh...
Works fine now.
And thanks for the great "quirky" suggestion. :)

Eva


On 2011-05-07 16:44, Michael Kann wrote:
Eva,

I just realized you posted on the metacard list. You might want to also check out the
LiveCode list also. It is the more recent version of the metacard list.

Here it is:

How to use LiveCode" <use-livecode@...>

--- On Sat, 5/7/11, Mark Schonewille <m.schonewille@...> wrote:

From: Mark Schonewille <m.schonewille@...>
Subject: Re: setting itemdel
To: "Discussions on Metacard" <metacard@...>
Date: Saturday, May 7, 2011, 9:06 AM

Hi Eva,

I'm not sure what you are having problems with, but if you want to get the items of a line, you need to set the itemdel to tab.

set the itemDel to tab
put item 2 of line 3 of myData into fld "Product"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 7 mei 2011, at 16:02, Eva Isotalo wrote:

> MC 2.4.3
>
> How do I "catch" the different parts of a file that has columns like this?:
> 1     Rose Floral Wax: (Size: 25g; )     FW07-25     £3.65     £3.65
> 1     Jasmine Grandaflorum Floral Wax (Size: 25g; )     FW03-25     £2.95     £2.95
> 1     Mimosa Floral Wax (Size: 25g; )     FW05-25     £2.95     £2.95
>
>
> I have no problems reading it but I'm trying to make an app that will read invoices in to a inventory program where each product will get it's own card.
>
> Eva



_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
metacard@...
http://lists.runrev.com/mailman/listinfo/metacard

-----Inline Attachment Follows-----

_______________________________________________
metacard mailing list
metacard@...
http://lists.runrev.com/mailman/listinfo/metacard

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

RE: Re: setting itemdel

FlexibleLearning.com
In reply to this post by Eva Isotalo-2
Eva

replace " (Size: 100ml; )" with " 100" in fld "Product"


But you have different 'size' values. This removes the non-numeric
characters...

  set the itemDel to TAB
  repeat with n=1 to num of lines of fld "Product"
    replace "(Size: " with "" in item 2 of line n of fld "Product"
    replace "ml;)" with "" in item 2 of line n of fld "Product"
    replace "g;)" with "" in item 2 of line n of fld "Product"
  end repeat


Hugh Senior
FLCo



Ok, a continuation. On lines like the following I'd like to be able to
catch and delete the '(Size: 100ml;)' but keep the '100'. How would I go
about doing this?

1     Benzoin (Mobile) Siam (Size: 100ml; )     EO16-100     7.55
Eva


On 2011-05-07 16:06, Mark Schonewille wrote:
> Hi Eva,
>
> I'm not sure what you are having problems with, but if you want to get the
items of a line, you need to set the itemdel to tab.

>
> set the itemDel to tab
> put item 2 of line 3 of myData into fld "Product"
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
>
> New: Download the Installer Maker Plugin 1.6 for LiveCode here
http://qery.us/ce
>
> On 7 mei 2011, at 16:02, Eva Isotalo wrote:
>
>> MC 2.4.3
>>
>> How do I "catch" the different parts of a file that has columns like
this?:
>> 1 Rose Floral Wax: (Size: 25g; ) FW07-25 ?3.65 ?3.65
>> 1 Jasmine Grandaflorum Floral Wax (Size: 25g; ) FW03-25 ?2.95 ?2.95
>> 1 Mimosa Floral Wax (Size: 25g; ) FW05-25 ?2.95 ?2.95
>>
>>
>> I have no problems reading it but I'm trying to make an app that will
read invoices in to a inventory program where each product will get it's own
card.
>>
>> Eva
>
>
> _______________________________________________
> metacard mailing list
> [hidden email]
> http://lists.runrev.com/mailman/listinfo/metacard
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.runrev.com/pipermail/metacard/attachments/20110507/e7a7acc5/at
tachment-0001.html>

------------------------------

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard


End of metacard Digest, Vol 83, Issue 2
***************************************
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1325 / Virus Database: 1500/3622 - Release Date: 05/07/11


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: setting itemdel

Eva Isotalo-2
Thank you!
Seems to work now. :)

Eva


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

RE: Re: setting itemdel

Alain Farmer
In reply to this post by FlexibleLearning.com
Best solution for this would be a GREP pattern. :)

Example:  .*([0-9]+).*

PS: use metacard's replaceText syntax.

Al

> replace " (Size: 100ml; )" with " 100" in fld "Product"
>
>
> But you have different 'size' values. This removes the
> non-numeric
> characters...
>
>   set the itemDel to TAB
>   repeat with n=1 to num of lines of fld "Product"
>     replace "(Size: " with "" in item 2 of line n
> of fld "Product"
>     replace "ml;)" with "" in item 2 of line n of
> fld "Product"
>     replace "g;)" with "" in item 2 of line n of
> fld "Product"
>   end repeat
>
>
> Hugh Senior
> FLCo
>
>
>
> Ok, a continuation. On lines like the following I'd like to
> be able to
> catch and delete the '(Size: 100ml;)' but keep the '100'.
> How would I go
> about doing this?
>
> 1     Benzoin (Mobile) Siam (Size:
> 100ml; )     EO16-100 
>    7.55
> Eva
>
>
> On 2011-05-07 16:06, Mark Schonewille wrote:
> > Hi Eva,
> >
> > I'm not sure what you are having problems with, but if
> you want to get the
> items of a line, you need to set the itemdel to tab.
> >
> > set the itemDel to tab
> > put item 2 of line 3 of myData into fld "Product"
> >
> > --
> > Best regards,
> >
> > Mark Schonewille
> >
> > Economy-x-Talk Consulting and Software Engineering
> > Homepage: http://economy-x-talk.com
> > Twitter: http://twitter.com/xtalkprogrammer
> > KvK: 50277553
> >
> > New: Download the Installer Maker Plugin 1.6 for
> LiveCode here
> http://qery.us/ce
> >
> > On 7 mei 2011, at 16:02, Eva Isotalo wrote:
> >
> >> MC 2.4.3
> >>
> >> How do I "catch" the different parts of a file
> that has columns like
> this?:
> >> 1     Rose Floral Wax: (Size: 25g;
> )     FW07-25     ?3.65
>     ?3.65
> >> 1     Jasmine Grandaflorum Floral
> Wax (Size: 25g; )     FW03-25
>     ?2.95     ?2.95
> >> 1     Mimosa Floral Wax (Size: 25g;
> )     FW05-25     ?2.95
>     ?2.95
> >>
> >>
> >> I have no problems reading it but I'm trying to
> make an app that will
> read invoices in to a inventory program where each product
> will get it's own
> card.
> >>
> >> Eva
> >
> >
> > _______________________________________________
> > metacard mailing list
> > [hidden email]
> > http://lists.runrev.com/mailman/listinfo/metacard
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://lists.runrev.com/pipermail/metacard/attachments/20110507/e7a7acc5/at
> tachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> metacard mailing list
> [hidden email]
> http://lists.runrev.com/mailman/listinfo/metacard
>
>
> End of metacard Digest, Vol 83, Issue 2
> ***************************************
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1325 / Virus Database: 1500/3622 - Release
> Date: 05/07/11
>
>
> _______________________________________________
> metacard mailing list
> [hidden email]
> http://lists.runrev.com/mailman/listinfo/metacard
>

_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

RE: Re: setting itemdel

FlexibleLearning.com
In reply to this post by Eva Isotalo-2
A regex would certainly be better. As it requires a degree of coding
proficiency that was not evident when the question was initially raised, I
provided a solution to suit.

Would you like to give us your matchtext solution rather than a copied
generic?

Hugh Senior
FLCo


Alain Farmer wrote:

Best solution for this would be a GREP pattern. :)

Example:  .*([0-9]+).*

PS: use metacard's replaceText syntax.

Al

> replace " (Size: 100ml; )" with " 100" in fld "Product"
>
>
> But you have different 'size' values. This removes the
> non-numeric characters...
>
> ? set the itemDel to TAB
> ? repeat with n=1 to num of lines of fld "Product"
> ? ? replace "(Size: " with "" in item 2 of line n
> of fld "Product"
> ? ? replace "ml;)" with "" in item 2 of line n of
> fld "Product"
> ? ? replace "g;)" with "" in item 2 of line n of
> fld "Product"
> ? end repeat
>
>
> Hugh Senior
> FLCo


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard
Reply | Threaded
Open this post in threaded view
|

Re: Re: setting itemdel

Alain Farmer
function extractNumberFromString pString
  put ".*([0-9]+).*" into myRegex
  local x,y
  if matchChunk(pString, myRegex, x, y)
  then return char x to y of pString
  else return pString -- unmodified string to leave field as-is.
end extractNumberFromString

on example
  -- field contains: " (Size: 100ml; )"
  -- it should contain just the value: 100
  put extractNumberFromString(fld "Product") into fld "Product"
  -- e.g. replaces " (Size: 100ml; )" with 100
  -- if it fails then it leaves string intact.
end example


From: FlexibleLearning <[hidden email]>
To: [hidden email]
Sent: Sunday, May 8, 2011 1:14:19 PM
Subject: RE: Re: setting itemdel

A regex would certainly be better. As it requires a degree of coding
proficiency that was not evident when the question was initially raised, I
provided a solution to suit.

Would you like to give us your matchtext solution rather than a copied
generic?

Hugh Senior
FLCo


Alain Farmer wrote:

Best solution for this would be a GREP pattern. :)

Example:  .*([0-9]+).*

PS: use metacard's replaceText syntax.

Al

> replace " (Size: 100ml; )" with " 100" in fld "Product"
>
>
> But you have different 'size' values. This removes the
> non-numeric characters...
>
> ? set the itemDel to TAB
> ? repeat with n=1 to num of lines of fld "Product"
> ? ? replace "(Size: " with "" in item 2 of line n
> of fld "Product"
> ? ? replace "ml;)" with "" in item 2 of line n of
> fld "Product"
> ? ? replace "g;)" with "" in item 2 of line n of
> fld "Product"
> ? end repeat
>
>
> Hugh Senior
> FLCo


_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard



_______________________________________________
metacard mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/metacard