download all quarterly index zip files from SEC 
////////////////////////////
Stating lines
         infile=
         outfile=   
         download.file(inFile,outFile,mode ='wb',method = 'libcurl')

          https://www.sec.gov/Archives/edgar/full-index/

 Step 1: download one zip file
 Step 2: add y and q to download one zip file
 Step 3: one loop q from 1 to 4
 Step 4: two loops: y from 1993 to 2020 and q from 1 to 4

/////////////////////////

download all financial statement data sets 
////////////////////////////
The location is given below. 
----------------------------
  SEC Financial Statement Data Sets    
       https://www.sec.gov/dera/data/financial-statement-data-sets.html         
  Manual:
       https://www.sec.gov/files/aqfs.pdf                                       

/////////////////////////

download all SF1 census SAS data sets
////////////////////////////
Download all SAS data sets for 50 states plus Washington DC

   Source of data

   Missouri Census Data Center (MCDC) 
       https://mcdc.missouri.edu/data/sf12010/Datasets.html    

/////////////////////////

Generate 1,000 output files 
////////////////////////////
Step 1: generate a data set
        x<-1:10

Step 2: save it. 
        outfile<-'fun1.txt'
        write(x,outfile)

Step 3: write a loop to generate 1000 output files 

        [this part in-class-exercise ]

/////////////////////////

File managements 
////////////////////////////
> apropos('^file.')
 [1] 'file.access'  'file.append'  'file.choose'  'file.copy'   
 [5] 'file.create'  'file.edit'    'file.exists'  'file.info'   
 [9] 'file.link'    'file.mode'    'file.mtime'   'file.path'   
[13] 'file.remove'  'file.rename'  'file.show'    'file.size'   
[17] 'file.symlink' 'file_test'    'fileSnapshot'
> 

# assume that we have generate 1,000 output files from fun1.txt, fun2.txt, up to fun1000.txt
# with the following two lines, we can remove them all 

a<-dir(pattern="fun")
file.remove(a)

/////////////////////////

Save a novel to 1,000 output files
////////////////////////////
 Step 1: Retrieve the  book called "The Count The Count of Monte Cristo"
          at http://gutenberg.org/files/1184/1184-0.txt

[1] The Project Gutenberg eBook of The Count of Monte Cristo, by Alexandre Dumas, pere
[2]                                                                                       
[3] This eBook is for the use of anyone anywhere in the United States and                 
[4] most other parts of the world at no cost and with almost no restrictions              
[5] whatsoever. You may copy it, give it away or re-use it under the terms                
[6] of the Project Gutenberg License included with this eBook or online at                

 Step 2: Count how many lines

 Step 3: Save the novel to 1,000 files 
/////////////////////////