Search Results

Search: Posts Made By: blito_loco
4,472
Posted By Scrutinizer
Perl version of the same thing: perl -pe...
Perl version of the same thing:
perl -pe 's/.*?"(.*?)".*?/\1 /g'
4,472
Posted By ahmad.diab
using Perl:- perl -wlne 'printf "$1 " while...
using Perl:-

perl -wlne 'printf "$1 " while (s/\"(.*?)\"//);' infile.txt

;););)
4,472
Posted By ygemici
# echo '--yyy "test test2" sadasds --xxx "demo...
# echo '--yyy "test test2" sadasds --xxx "demo demo2"' | sed 's/.*-xxx \(.*\)/\1/'
"demo demo2"

# echo '--yyy "test test2" sadasds --xxx "demo demo2"' | sed 's/.*-xxx "\(.*\)"/\1/'
demo demo2
4,472
Posted By agama
Assuming one --xxx per line, and that there might...
Assuming one --xxx per line, and that there might be text following the quoted string, this will work:


sed -r 's/.*--xxx[^"]*"//; s/".*//'
4,472
Posted By kurumi
$ ruby -ne 'puts $_.scan(/\".[^"]*?\"/)' file ...
$ ruby -ne 'puts $_.scan(/\".[^"]*?\"/)' file
"test test2"
"demo demo2"



$ echo '--yyy "test test2" sadasds --xxx "demo demo2"' | ruby -e 'print gets.split("--xxx")[-1]'
"demo demo2"
4,472
Posted By Scrutinizer
sed 's/[^"]*"\([^"]*\)"[^"]*/\1 /g'...
sed 's/[^"]*"\([^"]*\)"[^"]*/\1 /g' infile
4,472
Posted By cabrao
$ sed 's/\(.*\)\(\".*\"\)\(.*\)\(\".*\"\)/\2...
$ sed 's/\(.*\)\(\".*\"\)\(.*\)\(\".*\"\)/\2 \4/g;s/\"//g' file
test test2 demo demo2
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy