Selasa, 18 Maret 2014

[smf_addin] Digest Number 3008

4 Messages

Digest #3008

Messages

Mon Mar 17, 2014 1:00 am (PDT) . Posted by:

boo1712

Hi, Dun know whether this is what you wanted.
You can turn off auto update for your spreadsheet (in formula tab, calculation option, set to to manual)


Then you can manually calculate only the worksheet/s that you want.


You can also use macro to calculate the sheets that you require.

Mon Mar 17, 2014 4:21 pm (PDT) . Posted by:

lawleesh

Hi Randy
When I change the security, how come the price doesn't come out?
=smfConvertData(smfstrExtr(smfGetTagContent("http://www.marketwatch.com/investing/Stock/c6L/analystestimates?countrycode=SG","p",1,">Previous Close"),"~","<"))
thanks
LL

Mon Mar 17, 2014 4:51 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Your smfGetTagContent() function is returning:

<span class="currency">$</span> 10.20

Your smfStrExtr() function says to extract data from the beginning of that
to the first "<". Instead, it looks like you should extract from the
"span>" to the end of the string. So, this should work:

=smfConvertData(smfstrExtr(smfGetTagContent("
http://www.marketwatch.com/investing/Stock/c6L/analystestimates?countrycode=SG","p",1,">Previous
Close"),"span>","~"))

The difference is that your UK extraction had the currency code AFTER the
amount, while the US extraction has the currency code BEFORE the amount. It
appears a universal extraction would need to remove the currency type --
not trivial. But these appear to work:

=smfConvertData(SUBSTITUTE(smfGetTagContent("
http://www.marketwatch.com/investing/Stock/c6L/analystestimates?countrycode=SG","p",1,">Previous
Close"),"<span"&smfstrExtr(smfGetTagContent("
http://www.marketwatch.com/investing/Stock/c6L/analystestimates?countrycode=SG","p",1,">Previous
Close"),"<span","span>")&"span>",""))

=smfConvertData(SUBSTITUTE(smfGetTagContent("
http://www.marketwatch.com/investing/Stock/3IN/analystestimates?countrycode=UK","p",1,">Previous
Close"),"<span"&smfstrExtr(smfGetTagContent("
http://www.marketwatch.com/investing/Stock/3IN/analystestimates?countrycode=UK","p",1,">Previous
Close"),"<span","span>")&"span>",""))

On Mon, Mar 17, 2014 at 4:21 PM, <lawrence.leesh@gmail.com> wrote:

>
> When I change the security, how come the price doesn't come out?
>
> =smfConvertData(smfstrExtr(smfGetTagContent("
> http://www.marketwatch.com/investing/Stock/c6L/analystestimates?countrycode=SG","p",1,">Previous
> Close"),"~","<"))
>
>

Mon Mar 17, 2014 6:59 pm (PDT) . Posted by:

lawleesh

Thanks for the detailed explanation. I understand what you are saying when I examined the source codes from the two different pages.

Tidak ada komentar:

Posting Komentar