摘要: 1、创建测试数据 [root@linuxprobe test]# cat a.txt e i j s e f s d g e d d 2、利用grep命令统计字符e出现的次数 [root@linuxprobe test]# grep -o "e" a.txt | wc -l 3 3、同时统计e和d出 阅读全文
posted @ 2020-10-03 18:15 小鲨鱼2018 阅读(1842) 评论(0) 推荐(0) 编辑
摘要: 1、使用vim编辑器创建测试数据 [root@linuxprobe test]# cat a.txt ewetrte fsdfgf dfghghj dsffgd hgfdwe 2、统计每一行f出现的次数 [root@linuxprobe test]# awk -F "f" '{print NF-1} 阅读全文
posted @ 2020-10-03 18:04 小鲨鱼2018 阅读(3999) 评论(0) 推荐(2) 编辑
摘要: 1、创建测试数据 [root@linuxprobe test]# dd if=/dev/zero bs=1024 count=40000 of=c.txt [root@linuxprobe test]# dd if=/dev/zero bs=1024 count=4000 of=d.txt [roo 阅读全文
posted @ 2020-10-03 17:53 小鲨鱼2018 阅读(932) 评论(0) 推荐(0) 编辑
摘要: 1、R语言strsplit用于分割字符串 创建测试数据 > test <- "aa bb cc dd ee ff" ##创建测试数据 > test [1] "aa bb cc dd ee ff" > class(test) ## 测试数据为字符 [1] "character" 2、按照指定分隔符拆分 阅读全文
posted @ 2020-10-03 16:48 小鲨鱼2018 阅读(17433) 评论(0) 推荐(0) 编辑
摘要: 1、使用vim创建测试数据 a.txt [root@linuxprobe test]# cat a.txt 1 w e t 2 s f h 3 z c g 4 e a g 5 a f w 6 k h d 7 w f r 2、删除指定的行 [root@linuxprobe test]# sed '3d 阅读全文
posted @ 2020-10-03 12:15 小鲨鱼2018 阅读(10375) 评论(0) 推荐(0) 编辑
摘要: 1、创建测试数据 > test <- as.data.frame(matrix(1:100,nrow = 10)) > test V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 1 1 11 21 31 41 51 61 71 81 91 2 2 12 22 32 42 52 62 7 阅读全文
posted @ 2020-10-03 11:37 小鲨鱼2018 阅读(10294) 评论(0) 推荐(0) 编辑