您好我這裏有一個列表:設置文本格式輸出在UNIX
list_1.txt
Alpha
Bravo
Charlie
和文件與以下文件名和內容的目錄:
Alpha_123。日誌
This is a sample line in the file
error_log "This is error1 in file"
This is another sample line in the file
This is another sample line in the file
This is another sample line in the file
error_log "This is error2 in file"
This is another sample line in the file
This is another sample line in the file
error_log "This is error3 in file"
This is another sample line in the file
This is another sample line in the file
Alpha_123.sh
This is a sample line in the file
This is another sample line in the file
This is another sample line in the file
error_log "This is errorA in file"
This is another sample line in the file
This is another sample line in the file
This is another sample line in the file
This is another sample line in the file
error_log "This is errorB in file"
This is another sample line in the file
This is another sample line in the file
error_log "This is errorC in file"
This is another sample line in the file
Bravo.log
Charlie.log
的Bravo.log和Charlie.log是類似內容Alpha.log
我想有這樣的輸出:
Alpha|"This is error1 in file"
Alpha|"This is error2 in file"
Alpha|"This is error3 in file"
Alpha|"This is errorA in file"
Alpha|"This is errorB in file"
Alpha|"This is errorC in file"
任何輸入是極大的讚賞。謝謝!
所以基本上,我想首先找到名稱中包含list_1.txt中的字符串模式的文件,然後找到錯誤消息並用|
你可以用格式化的問題開始 - https://stackoverflow.com/editing-help並添加你試過要解決這個問題是什麼.. – Sundeep
你的問題還不清楚。更新你的描述 – RomanPerekhrest
你在做什麼 – Chris