entrée = P> sortie = p>
3 Réponses :
peut être fait à l'aide de Perl:
perl -pe 's{^\s*\n$}{}; s/ +(?=(([^"]+"){2})*[^"]*$)//g' file
Thisisanexampletextwithsomespaces. Thisshouldbe2ndline. Howeverthespacesbetween"quotes should not change". lastline.
Exemple avec gnu Sed :
$sed -r 's/(\".*\")|\s*/\1/g' file Thisisanexampletextwithsomespaces. Thisshouldbe2ndline. Howeverthespacesbetween"quotes should not change". lastline.