上一页 1 ··· 180 181 182 183 184 185 186 187 188 ··· 367 下一页
摘要: 1、 [root@PC1 test2]# ls a.txt test.py [root@PC1 test2]# cat a.txt ## 测试数据 dsfs JHDSF ADFD dfesr fKHJ FJfdf [root@PC1 test2]# cat test.py ## 转换程序 #!/us 阅读全文
posted @ 2022-06-01 23:13 小鲨鱼2018 阅读(566) 评论(0) 推荐(0) 编辑
摘要: 1、输出文本的前三行 [root@PC1 test2]# ls a.txt test.py [root@PC1 test2]# cat a.txt ## 测试数据 1 u j d 2 s f f 3 z c e 4 z v k 5 c f y 6 w q r 7 a d g 8 e f s [roo 阅读全文
posted @ 2022-06-01 22:28 小鲨鱼2018 阅读(1450) 评论(0) 推荐(0) 编辑
摘要: 1、 [root@PC1 test2]# ls a.txt b.txt test.sh [root@PC1 test2]# cat a.txt ## 测试数据 8 2 4 8 7 3 [root@PC1 test2]# cat b.txt 8 3 4 8 5 3 6 [root@PC1 test2] 阅读全文
posted @ 2022-06-01 20:38 小鲨鱼2018 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 1、 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt 8 4 2 2 8 3 1 3 4 3 4 6 [root@PC1 test2]# awk 'BEGIN{a = 0} {print $1 - a; a = $1}' a.txt ## 阅读全文
posted @ 2022-06-01 17:38 小鲨鱼2018 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 001、 1、矩阵转换为三元组 num <- c(5, 2, 7, 0, 9, 3, 4, 2, 3, 1, 7, 8) dat <- matrix(num, nrow = 3, ncol = 4, byrow = T) dat rows <- rep(1:nrow(dat), each = nco 阅读全文
posted @ 2022-06-01 16:29 小鲨鱼2018 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 1、输出列的累加和 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt 8 4 2 2 8 3 1 3 4 3 4 6 [root@PC1 test2]# awk '{sum += $1} {print sum}' a.txt ## 第一列累 阅读全文
posted @ 2022-06-01 13:30 小鲨鱼2018 阅读(2086) 评论(0) 推荐(0) 编辑
摘要: 001、删除含有空值的行 a <- c(3, NA, 4, 7, NA, 8) b <- c(1:2, NA, 3:5) c <- c(NA, "a", "k", "b", "c", "d") dat <- data.frame(a, b, c) dat na.omit(dat) ## 删除所有有空 阅读全文
posted @ 2022-06-01 11:36 小鲨鱼2018 阅读(12362) 评论(0) 推荐(0) 编辑
摘要: 1、小写转换为大写 [root@PC1 test]# ls a.txt test.py [root@PC1 test]# cat a.txt U R D S F E A D E x v m e f x e r d z d v [root@PC1 test]# cat test.py ## 小写转换为 阅读全文
posted @ 2022-05-31 23:15 小鲨鱼2018 阅读(1001) 评论(0) 推荐(0) 编辑
摘要: 1、 [root@PC1 test]# ls a.txt test.py [root@PC1 test]# cat a.txt U R D S F E A D E j k x v m j e f x e r d k j k u z d v [root@PC1 test]# cat test.py # 阅读全文
posted @ 2022-05-31 23:02 小鲨鱼2018 阅读(1074) 评论(0) 推荐(0) 编辑
摘要: 1、提取以x开头的行 [root@PC1 test]# ls a.txt test.py [root@PC1 test]# cat a.txt u r d s f e a d e x v m e f x e r d z d v [root@PC1 test]# cat test.py ## 提取以x 阅读全文
posted @ 2022-05-31 22:38 小鲨鱼2018 阅读(2447) 评论(0) 推荐(0) 编辑
上一页 1 ··· 180 181 182 183 184 185 186 187 188 ··· 367 下一页