Re: Sort Problem!
From: William James (w_a_x_man_at_yahoo.com)
Date: 08/25/05
- Next message: William James: "Re: Sort Problem!"
- Previous message: John L: "Re: Sort Problem!"
- In reply to: beholder_67_at_yahoo.com: "Sort Problem!"
- Next in thread: William James: "Re: Sort Problem!"
- Reply: William James: "Re: Sort Problem!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Aug 2005 09:46:47 -0700
beholder_67@yahoo.com wrote:
> Hello! I would like to sort a huge ascii file like this:
>
> Example:
>
>
> 412 five zero six eleven
> 540 rolex
> 076 Munich
> 090 I-2000-18
> 079 verfuegbar
>
> 027 ident
> 100 Allan Collins
> 104 Edward E. Smith
> 331 Readings
>
> 027 M:S89-004
> 100 B.J. Grosz
> 104 K. Sparck Jones
> 108 B.L. Webber
> 331 Readings in Natural Language Processing
> 425 1986
> 412 Los Altos
>
> My problem is the blank line between the 32434 blocks of data. (Its
> bibliographic data...)
ruby -pae'BEGIN{$/="\n\n";$;="\n"};$_=$F.sort.join("\n")+"\n\n"' file
Awk:
BEGIN{RS=""}
{ print $0 | "sort"
close( "sort" )
print ""
}
- Next message: William James: "Re: Sort Problem!"
- Previous message: John L: "Re: Sort Problem!"
- In reply to: beholder_67_at_yahoo.com: "Sort Problem!"
- Next in thread: William James: "Re: Sort Problem!"
- Reply: William James: "Re: Sort Problem!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|