摘要: 001、 [root@pc1 test2]# ls a.txt test.py [root@pc1 test2]# cat a.txt ## 测试序列 AGCTTCCCC [root@pc1 test2]# cat test.py ## 测试程序 #!/usr/bin/python in_file 阅读全文
posted @ 2022-11-16 18:21 小鲨鱼2018 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@pc1 test3]# ls a.txt [root@pc1 test3]# cat a.txt ## 测试数据 ad_33;hh_kk dd;ff;dd;77 uu_77_88_99 [root@pc1 test3]# awk -F "[_;]" '{print $2}' a 阅读全文
posted @ 2022-11-16 18:02 小鲨鱼2018 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 001、match >>> import re >>> str1 = "www.baidu.com" ## 测试字符串 >>> re.match("www", str1) <re.Match object; span=(0, 3), match='www'> >>> re.match("www", 阅读全文
posted @ 2022-11-16 16:21 小鲨鱼2018 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 001、shell实现 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试数据 1 4 6 10 8 16 17 20 [root@pc1 test2]# cat a.txt | tr " " "\n" | sed -e '1d' 阅读全文
posted @ 2022-11-16 14:41 小鲨鱼2018 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 001、shell实现 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试数据 a 8 b 3 a 9 a 2 b 3 c 7 c 2 c 10 [root@pc1 test2]# for i in a b c; do grep 阅读全文
posted @ 2022-11-16 11:16 小鲨鱼2018 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试数据 ab cd kk jj ee rr tt tt ss nn bb rr [root@pc1 test2]# rev a.txt | sed 's/ /_/' | r 阅读全文
posted @ 2022-11-16 10:29 小鲨鱼2018 阅读(201) 评论(0) 推荐(0) 编辑