Ich habe eine Datei abc.txt der InhaltWie bestimmtes Wort aus einer Textdatei
{ "storageSummary" drucken: { "binariesSummary": { "binariesCount": "703", "binariesSize":“ 882,39 MB "," artifactsSize ":" 3,41 GB "," Optimierung ":" 25,23% "," itemsCount ":" 4,126 "," artifactsCount ":" 1,917 "}," fileStoreSummary ": {" storageType ":" Datei -system "," storageDirectory ":"/jfrog_uat_nfs/binaries "," totalSpace ":" 1.30 TB "," usedSpace ":" 1.23 GB (0.09%) "," freeSpace ":" 1.30 TB (99.91%) "} , "repositoriesSummaryList": [{"repoKey": "sbt_remote-cache", "repoType": "CACHE", "foldersCount": 0, "filesCount": 0, "usedSpace": "0 Bytes", "itemsCount": 0, "packageType": "SBT", "Prozentsatz": "0%"}, {"repoKey": "test7.mvlo", "repoType": "LOCAL", "foldersCount": 0, "filesCount": 1 , "usedSpace": "128 Bytes", "itemsCount": 1, "packageType": "Maven", "Prozentsatz": "0%"}, {"repoKey" : "scripttestkp.rplo", "repoType": "LOCAL", "foldersCount": 0, "filesCount": 0, "usedSpace": "0 Bytes", "itemsCount": 0, "packageType": "RPM", "Prozentsatz": "0%"}, {"repoKey": "test7.grvr", "repoType": "VIRTUELL", "foldersCount": 0, "filesCount": 0, "usedSpace": "0 Bytes", "itemsCount": 0, "packageType": "Gradle", "Prozentsatz"
Aus dieser Datei, wie nur "RepoKey" und "UsedSpace" in Shell-Skript gedruckt werden.
Ist das ein 'json' Eingang ?, sieht aus wie ein gebrochener' JSON' Eingang Datei, und stellen Sie die komplette 'json' Eingabe zur Verfügung. – Inian
Verwenden Sie nach dem Reparieren der Eingabedatei einen geeigneten 'JSON'-Parser. – Inian
Warum sagen Sie, dass der Json falsch ist, Inian? Es scheint auf den ersten Blick okay zu sein ... sieht aus, als hätte er ein bisschen ausschneiden und einfügen können. Vielleicht –