I have a repeating list of this text, and the "testestewst" is unique for each item in the list:
testestetet *testest = [testeeste qtestest:@"I need this text"];
[testesteste:@"I need this text"];
[stesteset atestestest];
How in the world do I do a SED replace to remove everything but the text I need?
sed 's/.*"\(.*\)".*/\1/g' < test > result
works at least if you only one of such item per line... (replace 'test' and 'result' with the names of input and output files.
EDIT :
sed 's/^[^"]*$//g' < test | sed 's/.*"\(.*\)".*/\1/g' > result
Replaces also all lines without quotes with new lines...
If I understand what you are asking for, this should work...I went to some trouble to only return quoted text on lines containing an @. If your goal can be accomplished by just pulling out quoted text then it's possibly simpler.
$ cat > t1.sed
/@/{
s/[^"]*@"//
s/".*//
p
}
d
$ sed -f t1.sed t1.dat
I need this text
I need this text
$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With