2021年2月26日金曜日

EPS 2021FEB26

 


eps_year_xts["2020::"]

             [,1]

2020-01-01 116.33
2020-04-01  99.23
2020-07-01  98.22
2020-10-01  96.45
2021-01-01 119.73
2021-04-01 139.51
2021-07-01 146.75
2021-10-01 154.78


$    tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'

eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 116.33
eps_year_xts["2019::"][6] <- 99.23
eps_year_xts["2019::"][7] <- 98.22
eps_year_xts["2019::"][8] <- 91.15
eps_year_xts["2019::"][9] <- 114.36
eps_year_xts["2019::"][10] <- 133.35
eps_year_xts["2019::"][11] <- 141.08
eps_year_xts["2019::"][12] <- 155.56

2021年2月19日金曜日

ゼロサプレス zero supress bash awk split 文字列分割

 bash

$ seq -f %03g 1 10

001
002
003
004
005
006
007
008
009
010


ループ  loop

for i in `seq -f %03g 1 90`; do wget https://blog-imgs-77-origin.fc2.com/u/r/u/urutoraerogazou/matsushima-kaede-166-$i.jpg ; done


for i in `seq 414 453`; do wget  https://blog-imgs-76-origin.fc2.com/d/e/n/densetsuav/1543tachibanarikopin-$i.jpg ; done


二重ループ double loop サンプル

for j in `seq 1 34`
    do for i in `seq 1 12`
      # do wget -r https://javtube.com/javpic/ameri-ichinose/$j/ameri-ichinose-$i.jpg
      do wget -r https://jjgirls.com/japanese/rin-aikawa/$j/rin-aikawa-$i.jpg
  done
done




R


 for(i in seq(1,47,1)){ colnames(mdf)[i] <-  (paste(sprintf("%02d",i),colnames(mdf)[i],sep=""))}


sprintf("%.2f",100.0111)

[1] "100.01"

sprintf("%.3f",100.0111)

[1] "100.011"

sprintf("%.5f",100.0111)

[1] "100.01110"

sprintf("%.6f",100.0111)

[1] "100.011100"



awk


awk '{$3=sprintf("%02d", $3);


find . -print | awk -F\. '{print $2}' | grep k | awk -F\/ '{print $3"-"$2}' | awk '{split($0,a,"-"); print "cp \.\/"a[4]"\/"a[1]"-"a[2]"-"a[3]".jpg  ~\/tmpimage\/kaede\/jjgirls.com\/"a[1]a[2]a[4]"-"a[3]".jpg"}' > kaedecp.txt


split($0,a,"-")で行全体を-で区切って分割する。分割した各要素はa[i]でアクセスできる。

2021年2月16日火曜日

append new entries to xts object.

 

last(tmp.predict,3)

        SP5.Open SP5.High  SP5.Low SP5.Close   SP5.Volume   spline      eps
10 2020 3385.870 3549.850 3233.940  3269.960  89737600000 3475.842 3450.187
11 2020 3296.200 3645.990 3279.740  3621.630 100977880000 3465.431 3396.378
12 2020 3645.870 3760.200 3633.400  3756.070  96056410000 3420.055 3238.727


create the entry for "2021-01-01". first to create single row matrix and convert to the xts.

as.xts(matrix(c(as.vector(apply.monthly(SP5["2021-01"],mean)),3395,3180),nrow=1),as.Date("2021-01-01"))[,-5]

                    [,1]          [,2]            [,3]             [,4]       [,5]                 [,6]    [,7]
2021-01-01 3797.387 3818.136 3768.962 3793.748 5555199474 3395 3180


run append.

append(tmp.predict,as.xts(matrix(c(as.vector(apply.monthly(SP5["2021-01"],mean)),3395,3180),nrow=1),as.Date("2021-01-01"))[,-5]) %>% last(.,6)

        SP5.Open SP5.High  SP5.Low SP5.Close   SP5.Volume   spline      eps
 8 2020 3288.260 3514.770 3284.530  3500.310  84402300000 3270.029 3340.749
 9 2020 3507.440 3588.110 3209.450  3363.000  92084120000 3416.319 3423.604
10 2020 3385.870 3549.850 3233.940  3269.960  89737600000 3475.842 3450.187
11 2020 3296.200 3645.990 3279.740  3621.630 100977880000 3465.431 3396.378
12 2020 3645.870 3760.200 3633.400  3756.070  96056410000 3420.055 3238.727
 1 2021 3797.387 3818.136 3768.962  3793.748   5555199474 3395.000 3180.000


2021年2月5日金曜日

EPS 2021FEB05

 


eps_year_xts["2020::"]

             [,1]

2020-01-01 116.33
2020-04-01  99.23
2020-07-01  96.47
2020-10-01  92.18
2021-01-01 106.60
2021-04-01 125.68
2021-07-01 132.68
2021-10-01 140.24

$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'

eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 116.33
eps_year_xts["2019::"][6] <- 99.23
eps_year_xts["2019::"][7] <- 98.22
eps_year_xts["2019::"][8] <- 96.45
eps_year_xts["2019::"][9] <- 119.73
eps_year_xts["2019::"][10] <- 139.51
eps_year_xts["2019::"][11] <- 146.75
eps_year_xts["2019::"][12] <- 154.78