• 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: Martin Orpen <email@hidden>
  • Date: Fri, 15 Dec 2006 19:14:58 +0000

On 15 Dec 2006, at 15:19, Mark J. Reed wrote:

The goal is to write something that, given this line as input:

17    "Security Update for Exchange 2000 Server (KB894549)"
zeroDotZero       application  2005-10-7,13:45:34.0

will produce as output a list of five fields,where the first field is
"17", the second is "Security Update for Exchange 2000 Server
(KB894549)", the third is "zeroDotZero", the fourth is "application",
and the fifth is "2005-10-7,13:45;34.0".

Awk's default column-split behavior won't do that.

Oh yeah?

	awk 'BEGIN { FS="  +"; OFS=" | " } { print $1, $2, $3, $4, $5 }'

-->
17 | "Security Update for Exchange 2000 Server (KB894549)" | zeroDotZero | application | 2005-10-7,13:45:34.0



He shoots, he scores...

--
Martin Orpen
Idea Digital Imaging Ltd


_______________________________________________ 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: "Mark J. Reed" <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>)

  • Prev by Date: Re: rm does not always remove immediately
  • Next by Date: Re: awk question
  • Previous by thread: Re: awk question
  • Next by thread: Re: awk question
  • Index(es):
    • Date
    • Thread