Hallo liebe Ubuntuuser,
ich habe ein wichtiges Anliegen mit der Shell.
habe verschiedene Datensätze folgender Form:
"""addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Tulpenweg""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Uhlandstraße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Ulmenweg""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Veilchenweg""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Waldstraße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Wertstraße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Wilhelm-Busch-Weg""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1"",""addr:postcode""=>""73779"",""addr:street""=>""Wilhelmstraße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1/1"",""addr:postcode""=>""73779"",""addr:street""=>""Ahornweg""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""1/1"",""addr:postcode""=>""73779"",""addr:street""=>""Jahnstraße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""10"",""addr:postcode""=>""73779"",""addr:street""=>""Achalmstraße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""10"",""addr:postcode""=>""73779"",""addr:street""=>""Altbacher Straße""" """addr:city""=>""Deizisau"",""addr:country""=>""DE"",""addr:housenumber""=>""10"",""addr:postcode""=>""73779"",""addr:street""=>""Alte Bergstraße"""
Da wollte ich nun die Stadt, die Hausnummer, die PLZ und den Straßennamen sauber extrahieren für eine CSV-Datei.
Wie könnte ich dafür ein Skript anfertigen, ist es mit Substringsuche, und dann nochmal nach Suche nach dem nächsten " oder geht es eleganter?
Vielen Dank