• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: awk question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: awk question


  • Subject: Re: awk question
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 15 Dec 2006 14:34:00 -0500

On 12/15/06, Martin Orpen <email@hidden> wrote:
        awk 'BEGIN { FS="  +"; OFS=" | " } { print $1, $2, $3, $4, $5 }'

He shoots, he scores...

Offensive foul!

That may happen to work on the sample data (though not quite, since it
leaves the quotation marks in the field value), but it doesn't
generalize. With some extra code to strip the quotes off, it might
even be good enough for John's actual data set, but it doesn't meet
the stated objective.  A quoted string containing two adjacent spaces
will get split; two unquoted words with only a single space between
them will get joined.

--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: awk question
      • From: Martin Orpen <email@hidden>
References: 
 >Re: awk question (From: "John C. Welch" <email@hidden>)
 >Re: awk question (From: Martin Orpen <email@hidden>)
 >Re: awk question (From: email@hidden)
 >Re: awk question (From: Martin Orpen <email@hidden>)
 >Re: awk question (From: "Mark J. Reed" <email@hidden>)
 >Re: awk question (From: Martin Orpen <email@hidden>)

  • Prev by Date: Re: awk question
  • Next by Date: Re: Send selected messages as attachments in Mail.app
  • Previous by thread: Re: awk question
  • Next by thread: Re: awk question
  • Index(es):
    • Date
    • Thread