Using Awk

I am trying to write an awk script to identify and edit (sub) a set of lines embedded in a file. The lines are identified by the first one starting with a "[" and the last one ending with a "]". I want to remove the line feeds (carriage returns) from the identified lines. The documentation on awk generally implies it accepts \n in regular expressions, but I don't seem to be able to get a match using either \n or \r, much less get a substitution. It's been a long time since I have used awk, but I believe I have done this sort of thing with it before. Sed is not helpful in the same way.

MacBook Pro, Mac OS X (10.6.2)

Posted on Jan 12, 2010 11:41 AM

Reply
3 replies

Jan 12, 2010 8:02 PM in response to Allan Wylie2

Besides taking this to the Mac OS X Technologies Unix Forum, I would suggest you post an example of text you want to mung via awk.

And put the example text inside of


...
...example text here...
...


the {code} tags will prevent the forum software from messing with your text.

With example text in the Unix forum, we will be able to experiment with your text and see if there is a useful awk (or maybe perl) solution.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Using Awk

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.