0
$\begingroup$

Writing:

Quiet[Length[Import["http://www.africau.edu/images/default/sample.pdf"]]]

I get:

2

while writing:

Quiet[Length[Import["http://www.africau.edu/images/default/sampl.pdf"]]]

I get:

0

This is my crude method to check if a URL matches a document or not. Is there a more efficient method? Thank you!

$\endgroup$
  • $\begingroup$ You can do it faster by importing the "String" import format and comparing that to the document you have $\endgroup$ – b3m2a1 May 26 at 16:55
  • $\begingroup$ @b3m2a1: thanks for the answer but honestly I don't understand what you mean, could you explain me a little? $\endgroup$ – TeM May 26 at 17:18
  • 1
    $\begingroup$ Use the second arg to Import $\endgroup$ – b3m2a1 May 26 at 17:40
  • $\begingroup$ Fantastic, now it's definitely more efficient! Thank you! $\endgroup$ – TeM May 26 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.