Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

need help with awk and sed commands

Jul 19, 2007 12:29AM PDT

Hi,

I am attempting to use awk and sed commands to retrieve certain portions of a line of text in a file.

****************************

Here is a short portion of the text file:

Update #000 - Initial installation/upgrade (contains all classes, routines, globals and crystal reports)

Update #001 - Patch #001 - This update resolves the error <MAXSTRING>GetRows1+14^GUIChartReview. This error can occur when an item within chart review contains a large number of entries.

*****************************

I would like for the script to retrieve only the lines that contain error codes, which for example would be the "<MAXSTRING>GetRows1+14^GUIChartReview" portion as well as displaying which update fixes this, in this case update #001.

The excess text other than "<MAXSTRING>GetRows1+14^GUIChartReview" and "Update #001" is not needed.

My hope is for this to display the information saved in a file in column format similar to:

Update# 001 "<MAXSTRING>GetRows1+14^GUIChartReview"
Update# <###> <"ERROR MESSAGE HERE">

Etc...


I am very new to this, and am unsure if this is the correct place to ask.

Any help is appreciated!

Discussion is locked