Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an Online AWK ref? 1

Status
Not open for further replies.

SMerrill

Programmer
Jan 19, 2002
145
US
Q1: Where can I find a web-based AWK reference manual so I don't have to hound this forum with dumb questions?

Q2: How do I represent a null (ASCII=0) in a regexp?

Q3: The new version of my input file contains a field of 356 NULLs separating each report, (multiple reports per file) yet the newline in each record of the report appears to be hex 0D 0D 0A.

The existing AWK script deals with a report separator of 0D 0A 0A 0A so it was much easier to use the newline carat to signify the beginning of a report by recognizing
Code:
/^First chars of each report/
So how do I convert the field of nulls into an 0D 0A so I can pretend my reports still begin on a new line?

Thanks,



Take care,
--Shaun Merrill
Seattle, WA
 
> Q1: Where can I find a web-based AWK reference manual
A couple of resources spring to mind

> Q2: How do I represent a null (ASCII=0) in a regexp?
I would say /\0/
However, the GAWK manual page notes that some AWK implementations cannot match nul's

> yet the newline in each record of the report appears to be hex 0D 0D 0A.
Try setting
Code:
RS="\r\r\n"

--
 
Thanks for the great online references!


Take care,
--Shaun Merrill
Seattle, WA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top