Need command or script to fetch only specific paragraph from a file in Unix/Linux
Files formatting is like
=================================
THREAD NUMBER
MESSAGE NUMBER
Severity
File_LOCATION
FUNCTION_NAME
LINE_NUMBER
TIME STAMP
BLANK LINE
SINGLE LINE ERROR TEXT
=================================
Here i Want to extract only severity and message text part for user input severity.
Maybe you can use cat file | tail --lines=+3 | head -1
cat file | tail --lines=+3 | head -1
cat file | tail --lines=+3 | head -1
to get the third line out of the given file. But I don't know if this is what you want or need.
尝试这个:
awk "/Severity: $1/,/File_LOCATION/" < file_name > out.txt
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.