× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



When you say "sort a file", what do you mean, exactly? You mean you want to physically sort the records in this sequence?

Or do you mean that you are writing code that reads the file, and you want it to be read in this sequence?

Are you writing this code in RPG? RPG w/SQL? PHP? Java? Cobol?

I'm thinking along the same lines as what Brian suggested, i.e. use qsort()... but then I thought, "well, he says he wants to sort a file, not an array". So I don't know if the qsort() would work. Plus, without knowing what language you're coding in, how do I know you can use qsort?

Then I thought, "maybe an SQL UDF". But then, "maybe he's not using SQL!" and "maybe a UDF would be too slow" and "maybe he wants to physically sort the records, not just read in that sequence".

Perhaps I think too much.



Jon S wrote:

I have the need to sort a file of IP addresses on a display as if they had a leading zero. For example they want to see


192.44.208.119 192.44.208.12 192.44.208.120
to be sorted as


192.44.208.12 192.44.208.119 192.44.208.120
as if the .12 had a leading zero. This is a character field. Any suggestions? Thanks in advance.


Jon
_________________________________________________________________
Windows 7: It helps you do more. Explore Windows 7.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3:102009


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.