Hello monks!
I am new to Perl and I don't know what I can do to solve the following problem:
I want to contact an ftp site (namely:
ftp://ftp.ncbi.nih.gov/genomes/Bacteria) and download locally all the subfolders in it, but downloading only files with the extension
.faa).
For example, I want to download tha folder
Bacteria (as I wrote previously) and then, recursively, download all subfolders (like
Acidobacteria_bacterium_Ellin345) and only the files with extension .faa (like
NC_008009.faa which is inside the
Acidobacteria_bacterium_Ellin345 folder). I thought of downloading the whole ftp folder with
wget -r command of Linux, but the files are rather large and will take sometime. I believe I must store all the names of the folders in a list and then open each folder and apply
wget only to the files with
.faa extension. I have no idea how I contact with ftp sites using Perl though...
Any hints would be grately appreciated...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.