HTTP 링크에서 ZIP 파일 가져오기ZIP 파일을 게시했으며 프로그래밍 방식으로 가져오고 JSL을 사용하여 내 PC에 저장하려고 합니다. 얼마나 많은 파일이 존재할지 미리 알 수 없습니다.
JSL로 가능합니까?

Re: HTTP 링크에서 ZIP 파일 가져오기당신이 그것에서 뭔가를 얻을 수 기쁘다! 패턴이 속도 면에서 개선될 수 있다고 확신합니다. 수천 개의 링크에 불과한 디렉토리의 경우 차이가 없을 수 있지만 len(1) 부분은 링크가 아닌 텍스트를 더 빠르게 건너뛸 수 있습니다. 그리고 링크에 대한 보다 유연한 패턴도 더 좋을 것입니다.
@bryan_boone @ErnestPasour @paul_vezzetti
Re: HTTP 링크에서 ZIP 파일 가져오기포괄적인 답변을 주신 Craig에게 감사드립니다. 두 제안의 요소를 취하여 현재 및 미래의 요구에 맞게 일반 함수로 병합하겠습니다.
HTTP 소스에서 링크를 찾으려면 REGEXP를 사용해야 한다는 것을 알고 있지만 zip 부분에 대한 '<< saveLink' 기능을 기대하고 있었습니다. 
그래도 완벽하게 작동합니다.
훌륭한 답변
Re: HTTP 링크에서 ZIP 파일 가져오기또는 이것은 당신이 요구하는 것에 더 가깝습니다.
path="https://www.vsp.virginia.gov/downloads/"; // a page with an index of files. Yours may be different format, adjust pattern below.
html = loadtextfile(path); // get the HTML text so we can scrape the links
// somewhat custom pattern for scraping the links, may be specific to this page
urls = {}; // this list will collect the urls
rc = patmatch(html,
patpos(0)+ // make sure the pattern matches from the start
patrepeat( // this is the loop that extracts the urls from the html
(
// the urls look like <A href="https://community.jmp.com/2017%20Virginia%20Firearms%20Dealers%20Procedrures%20Manual.pdf" target="_blank">
// and we want just the part between the quotation marks. Quickly scan forward (patBreak)
// for a < then see if it matches. >>url grabs the text between quotation marks.
(patbreak("<") + "</A><A href="\!""" target="_blank" rel="nofollow noopener noreferrer">> url + pattest(insertinto(urls,url);1))
| // OR
patlen(1) // skip forward one character
)
+
patfence() // fence off the successfully matched text. There is no need to backtrack if something goes wrong.
) +
patrepeat(patnotany("<"),0) + // any trailing bits of html are consumed here
patrpos(0) // make sure the pattern matches to the end
);
if(rc==0, throw("pattern did not match everything"));
show(nitems(urls),urls[6]); // pick item 6. You'll have a different strategy.
fullpath = path||regex(urls[6],"%20"," ",GLOBALREPLACE);// minimal effort to fix up the url, might need more work
pdfblob = loadtextfile(fullpath,blob); // download item 6, it is a pdf when this was written...
savetextfile("$temp/example.pdf",pdfblob); // save it somewhere</A>Re: HTTP 링크에서 ZIP 파일 가져오기
zip 파일 @윌캅 프레젠테이션
za=open("https://community.jmp.com/kvoqx44227/attachments/kvoqx44227/virtual-jug/12/1/VJUG%20July%202015.zip","zip");
zipfiles=za<
몇 가지 참고 사항
- 파일이 임시 디렉토리에 다운로드됩니다. 열기 위한 "zip" 옵션은 zip 아카이브 객체를 반환합니다.
- <
- JMP 테이블과 같은 이진 데이터를 읽기 위해 zip 아카이브와 함께 blob 형식을 사용할 수 있습니다.
- 세 번째 줄은 두 번째 인수를 사용하여 blob이 JMP 데이터 테이블임을 open에 알립니다.
- 전체 스크립트를 다시 실행하는 경우 za 변수를 지워야 합니다. zip 아카이브 개체는 임시 디렉터리의 파일이 재사용되지 않도록 합니다.
- Blob과 함께 loadtextfile/savetextfile을 사용하여 zip 파일을 선택한 위치에 다운로드(완료되면 삭제)한 다음 zip 아카이브를 사용하여 해당 파일을 처리할 수 있습니다.
- 이미 아카이브 디렉토리의 4번째 항목이 JMP 데이터 테이블인 것을 확인했습니다.