how to find a string in the file
for instance
a string:"112321324AAAhow are you?AAAsdfsfdsfds" in file "test.txt" i want to find the string between "AAA" and "AAA". it means that i should find "how are you?" in test.txt what should i do? anyone help? thanks |
If you know the quote you are looking for: "how are you?"
You can try: Code:
$ cat test.txt | grep "how are you?" Hope this helps you out. |
I think you need to provide more information, ie do we know ahead of time what the string is between AAA's?
|
Quote:
i think it regular expression may solve it |
So something like:
Code:
sed -rn 's/.*AAA(.*)AAA.*/\1/p' test.txt |
All times are GMT -5. The time now is 09:52 AM. |