Mám súbor s niekoľkými odsekmi. Chcem vytiahnuť iba odsek.
Odkázal som na túto otázku
ale riešenie pre mňa nefunguje.
Tu je príklad mojich údajov
* This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. (STOP-String-023)
* This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. (Search-String-085)
Here is random text. Here is random text.
* This is a block of text it goes on and on. This is a block of text it goes on and on. This is a block of text it goes on and on. (Search-String-035)
Some text here
Some text here
Chcem vytiahnuť iba text od začiatku odseku do (Search-String...
ako to mám urobiť?
awk -v RS= "/Search-String[^n]/ text.txt
príkaz nefunguje.
odpovede:
0 pre odpoveď č. 1awk -v RS= "sub(/.*Search-String/,"")" text.txt
Ak to nie je to, čo chcete, upravte svoju otázku, aby ste objasnili svoje požiadavky a poskytli očakávaný výstup, ktorý bude sprevádzať váš uverejnený vstup vzorky.