SEC index website
///////////////////////
Step 1: at the following website
        https://www.sec.gov/Archives/edgar/full-index/

Step 2: download the first quarter in 2024 index
        file called company.idx

Step 3: run the following code

infile<-"c://temp/company.idx"
x<-readLines(infile,n=100)
print(head(x,20))

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

///////////////////////
source('http://datayyy.com/fmr/starter/ruler.R.txt')

path<-"http://datayyy.com/data_txt/"
file<-"index2024Q1_100lines.txt"
infile<-paste0(path,file)
x<-readLines(infile)

b<-x[9:12]
.ruler(b)

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

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

path<-"http://datayyy.com/data_txt/"
file<-"index2024Q1_100lines.txt"
infile<-paste0(path,file)
##
myWidths<-c(62, 9, 10, 15, 45)
x<-read.fwf(infile,myWidths,skip=11) 
colnames(x)<-c("NAME","FORM","CIK","DATEFILED","LOCATION")

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

merge() function 
///////////////////////

merge(x, y, by = intersect(names(x), names(y)),
      by.x = by, by.y = by, all = FALSE, all.x = all, all.y = all,
      sort = TRUE, suffixes = c(".x",".y"), no.dups = TRUE,
      incomparables = NULL, ...)

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

Merging two data sets by different names
///////////////////////
  Assume that we have two data sets called a, b. 
   We intend to merge that by ID for a and NAME for b. 

  x<-merge(a,b,by.x='ID',by.y='NAME')

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

Getting specific columns or rows from a matrix
///////////////////////
Assume that we have a matrix of x

 Getting a value         x[2,3]

 Getting a column        x[,2]

 Getting a row           x[2,]

 Getting a few columns   x[m2:10]

 Getting a few rows      x[1:10,]

 Using name             x$DATE
   (asume that the first column is DATE)

 Negative value means delete
                   x[,-2]  except the second column 

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

Retrieving a subset
///////////////////////

  Method I:   y<-x[,2]

  Method II:  y<-data.frame(x[,1],x[10])

  Method III: y<-data.frame(x[,-2])

  Method IV: using subset() function 

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