关于使用shell在文件中查找一段字符串的有关问题
关于使用shell在文件中查找一段字符串的问题
请问大家 如果在shell里想从一个文件里查找一段字符串 应该怎么做?
文件:
1.txt
内容:
12312312343242AAAdfasdfasdfasdfasdfadAAAfsdgfsdfgfgfgdfgasdfg
想找两个AAA之间的字符串。
谢谢各位了!
------解决方案--------------------
一样吧
awk -F"AAA" '{print $2}' yourfile
请问大家 如果在shell里想从一个文件里查找一段字符串 应该怎么做?
文件:
1.txt
内容:
12312312343242AAAdfasdfasdfasdfasdfadAAAfsdgfsdfgfgfgdfgasdfg
想找两个AAA之间的字符串。
谢谢各位了!
------解决方案--------------------
一样吧
awk -F"AAA" '{print $2}' yourfile