会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小鲨鱼2018
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
119
120
121
122
123
124
125
126
127
···
408
下一页
2023年6月4日
linux 中实现输出匹配字符之后或之前的若干行
摘要: 001、输出匹配字符之后的若干行 a、 [root@PC1 test4]# ls a.txt [root@PC1 test4]# cat a.txt ## 测试数据 01 02 kk 03 04 05 06 07 kk 08 09 10 11 12 ## 输出匹配字符之后的3行 [root@PC1
阅读全文
posted @ 2023-06-04 00:23 小鲨鱼2018
阅读(163)
评论(0)
推荐(0)
2023年6月3日
linux 中awk命令实现输出匹配字符的上下若干行
摘要: 001、 [root@PC1 test3]# ls test.txt [root@PC1 test3]# cat test.txt ## 测试数据 jjjj kkk gene jjj dddd yyy iiii ppp ffff 999 gene ttt eeee mmm aaaa nnn [roo
阅读全文
posted @ 2023-06-03 20:12 小鲨鱼2018
阅读(307)
评论(0)
推荐(0)
2023年6月2日
TypeError: 'dict_keys' object is not subscriptable
摘要: 001、python报错 >>> dict1 = {"aa":300, "bb":500, "cc":400, "dd":700} >>> dict1 {'aa': 300, 'bb': 500, 'cc': 400, 'dd': 700} >>> dict1.keys() dict_keys(['
阅读全文
posted @ 2023-06-02 13:05 小鲨鱼2018
阅读(657)
评论(0)
推荐(0)
AttributeError: 'dict_values' object has no attribute 'index'
摘要: 001、python报错如下: >>> dict1 = {"aa":700, "bb":400, "cc":300, "dd":600} >>> dict1.values().index(300) Traceback (most recent call last): File "<stdin>",
阅读全文
posted @ 2023-06-02 12:58 小鲨鱼2018
阅读(182)
评论(0)
推荐(0)
python 中根据值返回键
摘要: 001、 >>> dict1 = {"aa":500, "bb":400, "cc":700, "dd":300} >>> dict1 {'aa': 500, 'cc': 700, 'dd': 300, 'bb': 400} >>> dict1.keys()[dict1.values().index
阅读全文
posted @ 2023-06-02 00:27 小鲨鱼2018
阅读(34)
评论(0)
推荐(0)
2023年6月1日
linux 中 删除指定匹配特定字符指定次数之前或者之后的内容
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@PC1 test]# sed 's/ /tag/2'
阅读全文
posted @ 2023-06-01 15:45 小鲨鱼2018
阅读(226)
评论(0)
推荐(0)
2023年5月31日
python 中 re.match和re.search()函数
摘要: 两者都返回首次匹配字符串的索引,re.match函数只从头开始匹配, re.search函数不限制只从头开始匹配。 001、re.match函数 [root@PC1 test2]# python3 Python 3.10.9 (main, Mar 1 2023, 18:23:06) [GCC 11.
阅读全文
posted @ 2023-05-31 13:03 小鲨鱼2018
阅读(210)
评论(0)
推荐(0)
linux 中判断文件是否存在、是否为目录、文件、是否为空
摘要: 001、判断文件是否存在 (base) [root@PC1 test4]# ls a.txt dir01 (base) [root@PC1 test4]# if [ -e a.txt ]; then echo "exist"; fi ## 判断文件是否存在 exist (base) [root@PC
阅读全文
posted @ 2023-05-31 08:41 小鲨鱼2018
阅读(7556)
评论(0)
推荐(0)
R语言中barplot函数绘图实现x轴标签的倾斜显示
摘要: 001、代码 dat <- c(3, 8, 2, 9, 4) k <- barplot(dat, axes = FALSE, ylim = c(-4, 10) ,names.arg = FALSE) axis(2, at = seq(0, 10, 2)) label <- paste0("label
阅读全文
posted @ 2023-05-31 00:33 小鲨鱼2018
阅读(866)
评论(0)
推荐(0)
2023年5月30日
linux 中sed命令实现文本的大小写转换
摘要: 001、将所有的小写字母转换为大写 [root@PC1 test4]# ls a.txt [root@PC1 test4]# cat a.txt ## 测试数据 abd mnj uyr XDE THR QYE cvb Ddg gyi [root@PC1 test4]# sed 's/[a-z]/\U
阅读全文
posted @ 2023-05-30 21:29 小鲨鱼2018
阅读(886)
评论(0)
推荐(0)
上一页
1
···
119
120
121
122
123
124
125
126
127
···
408
下一页
公告