On Wed, 2010-06-02 13:19:50 +0200, Jan 'RedBully' Seiffert <[email protected]> wrote: > Jan-Benedict Glaw schrieb: > > On Tue, 2010-06-01 22:16:14 +0100, A. Dreyer (LUG-OWL) > > <[email protected]> wrote: > > > On 01/06/10 13:19, Jan-Benedict Glaw wrote: > > > > Mit dem IFS hatte ich schon gespielt; das machts aber nicht unbedingt > > > > einfacher, weil dann z.B. kein Komma mehr in einem der C-Strings > > > > auftauchen darf. Ebenso würden Geschichten wie > > > > > > > > foo ("This is a text with a real (\") quotation mark", 5.3); > > > > > > > > nicht mehr ordentlich geparst werden. > > > > > > Ich denke für eine derartige Aufgabe ist die Shell eigentlich das > > > falsche Tool und ich würde hier auf Perl und zB. Text::CSV zurück > > > greifen.. > > > > Wie siehts da mit dem Escape-Handling aus? (/me hat keine Ahnung von > > Perl.) > > awk? > > $ echo '"This is a text with a real (\") quotation mark", 5.3' | awk -F , > '{printf "%s\n%s\n", $1, $2}' > "This is a text with a real (\") quotation mark" > 5.3
Das hätte ein IFS=',' read x y z auch lösen können :) Hier ist der
Haken dann, daß kein Komma im String enthalten sein darf.
MfG, JBG
--
Jan-Benedict Glaw [email protected] +49-172-7608481
Signature of: http://perl.plover.com/Questions.html
the second :
signature.asc
Description: Digital signature
-- Linux mailing list [email protected] subscribe/unsubscribe: http://lug-owl.de/mailman/listinfo/linux Hinweise zur Nutzung: http://www.lug-owl.de/Mailingliste/hints.epo
