Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    unix sort utility for windows; configurable delimiter

    I have searched without success for a sort utility for windows with a configurable delimiter. In unix, you set the field delimiter when sorting data with multiple fields, but the windows version of sort does not seem to allow that.

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Are you talking about a command line sort function? If so, I'd downlaod cygwin. It allows you to run unix commands on windows.

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, I have cygwin. I am trying to make a .bat file calling gawk a few times, and there is a step that requires sorting on a vertical bar. I can't depend that the user will have cygwin installed.

    I am surprised that I could not find a nice little shareware utility that does this, or that windows sort does not allow configuring the delimiter.

  • #4
    Regular Coder
    Join Date
    Jan 2005
    Location
    Essex
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I dont think there is a utility for this correct if I am wrong though.
    Danny Hayes
    Under Construction www.hayes-design.co.uk

  • #5
    New to the CF scene
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was able to solve the probelm using multiple calls to sort, ren, and rem. Here is the unix line:

    sort -t\| +0n -1n +1 -2 file1 file1 > sorted

    and here is the windows version:

    sort /+1n file1 > sorted
    sort /+1n file2 >> sorted
    sort /+1n sorted >temp
    del sorted
    ren temp sorted


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •