私は何百もの単語を含むファイルを持っています。 ファイルの一部のセクションにアンダースコア(_)で始まり、カンマ(、)で区切られた単語があります。アンダースコアで始まる単語だけをコンマで区切って検索し、配列に保存したいと考えています。どうすればいいですか?シェルスクリプトを使用したファイルのパターンマッチング
しかし、それは単語ではなく行をリストします。
サンプルファイル(Appleのtbdファイル)。私はアンダースコアで始まる単語のリストを取得したい
archs: [ armv7, armv7s, arm64 ]
platform: ios
install-name: /System/Library/Frameworks/AVFoundation.framework/AVFoundation
current-version: 2.0
objc-constraint: retain_release
exports:
- archs: [ armv7, armv7s, arm64 ]
re-exports: [ /System/Library/Frameworks/AVFoundation.framework/libAVFAudio.dylib ]
symbols: [ _AVAssetAssociatedSubtitlesTrackReferencesKey, _AVAssetChapterListTrackReferencesKey,
_AVAssetChapterMetadataGroupsDidChangeNotification,
_AVAssetDownloadSessionAirPlayAuthorizationInfoKey,
_AVAssetDownloadSessionCachePrimingDownloadTokenKey,
_AVAssetDownloadSessionClientAuditTokenKey, _AVAssetDownloadSessionClientBundleIdentifierKey,
_AVAssetDownloadSessionCurrentLoadedTimeRangesKey,
_AVAssetDownloadSessionDeleteDownloadWhenAssetFinalizesKey,
_AVAssetDownloadSessionDidResolveMediaSelectionNotification,
_AVAssetDownloadSessionDownloadFailedNotification,
_AVAssetDownloadSessionDownloadSucceededNotification,
_AVAssetDownloadSessionFileSizeAvailableNotification,
_AVAssetDownloadSessionHTTPCookiesKey, _AVAssetDownloadSessionHTTPHeaderFieldsKey,
_AVAssetDownloadSessionLoadedTimeRangesChangedNotification,
_AVAssetDownloadSessionMaxSizeAllowedForCellularAccessKey,
_AVAssetDownloadSessionMediaSelectionKey, _AVAssetDownloadSessionMinimumRequiredMediaBitrateKey,
_AVAssetDownloadSessionNewlyLoadedTimeRangeKey,
_AVAssetDownloadSessionOptimizeAccessForLinearMoviePlaybackKey,
_AVAssetDownloadSessionPreferredAudibleMediaCharacteristicKey,
_AVAssetDownloadSessionPreferredLegibleMediaCharacteristicKey,
_AVAssetDownloadSessionPreferredVisualMediaCharacteristicKey,
_AVAssetDownloadSessionPriorityKey, _AVAssetDownloadSessionProtectedContentSupportStorageURLKey,
_AVAssetDownloadSessionPurchaseBundleKey, _AVAssetDownloadSessioniTunesStoreContentDSIDKey,
_AVAssetDownloadSessioniTunesStoreContentDownloadParametersKey,
_AVAssetDownloadSessioniTunesStoreContentIDKey,
_AVAssetDownloadSessioniTunesStoreContentInfoKey,
_AVAssetDownloadSessioniTunesStoreContentPurchasedMediaKindKey,
_AVAssetDownloadSessioniTunesStoreContentTypeKey,
_AVAssetDownloadSessioniTunesStoreContentUserAgentKey,
_AVAssetDownloadTaskMediaSelectionKey, _AVAssetDownloadTaskMinimumRequiredMediaBitrateKey,
_AVAssetDurationDidChangeNotification, _AVAssetExportPreset1280x720,
_AVAssetExportPreset1920x1080, _AVAssetExportPreset3840x2160,
_AVAssetExportPreset3GPRelease6MMS, _AVAssetExportPreset640x480,
_AVAssetExportPreset960x540, _AVAssetExportPresetAppleM4A,
_AVAssetExportPresetAudioOnlyMMS, _AVAssetExportPresetAuxSmall,
あなたはいくつかの行を示すことができ、どのように結果があなたの例のためにのように見えるのだろうか? –
「_words」を含む*セクション*とファイルの他の*セクション*を区別する方法の詳細を教えてください。良いスタートは、各タイプのセクションを持つサンプルを追加することです。 –