Link to home
Start Free TrialLog in
Avatar of slyfoxrules
slyfoxrules

asked on

sort by date and time

please could someone tell me how to sort new entries in a text file into date and time order!!!!

thanx
Avatar of AndrewDev
AndrewDev

You could read it into an ADO recordset using the Microsoft Text Driver and use the ADO recordset functionality to sort it

This link explains how to open the file in a recordset it:

http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForText

Once i a recordset you have great flexibility with regard to sorting, filtering etc.

Good Luck
AVD
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you're asking how you can add new lines to a file so the file stays sorted, you cannot. You can only add new lines at the end.

What you would need to do is read the file into your program, add the new line in the right location, and then write the file back out.

If you want to display the lines in a file sorted, the ADO suggestions are good. For an example that sorts the lines in a file by itself (without ADO), download:

    http://www.vb-helper.com/howto/sortfile.zip
Hi question-asker!

Something seems to be going wrong in this question, since it has been open for a long time. Maybe it's open because you don't know how to close it or something went wrong in deleting, PAQ-ing or grading.

When a question is resolved, it becomes a Previously Answered Question (PAQ), and will be stored in the database. Users who have similar problems can buy your question for 1/10 of the original point value in order to find a solution to *their* problem. You can read more about how the site works in our member agreement: https://www.experts-exchange.com/jsp/infoMemberAgreement.jsp

As a result it is important that you provide feedback to our experts. If their suggestions do not work, tell them why. If they do, award them by grading the answer so that the question does indeed become such a "PAQ". That way future visitors of this question get the most out of it.

If any of the participating experts want this question to remain open or does have a reason to let it be graded/closed by a moderator, please leave a comment to keep this thread alive.

If no expert participated in this question (e.g. there are no comments at all), please delete the question...

If you are having trouble doing and of this, please post a 0-point question in Community Support (https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt), and ask them for help.

Thanks!

Ps: Please don't be offended by this standard text. This text is only pasted into your question to get the list of open questions as short as possible and please DO NOT close the question by accepting this comment as an answer!
This question appears to have been abandoned. A question regarding will be left in the Community Support area regarding its disposition; if you have any comment about the question, please leave it there.

A moderator will be asked to resolve the question. Unless there is any objection or futher activity, the recommendation will be to split between AndrewDev / EDDYKT / RodStephens.

The link to the Community Support area is:
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.

Regards,

Max
Per recommendation, force-accepted by
Netminder
Community Support Moderator
Experts Exchange

AndrewDev: points for you at https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20279560
RodStephens: points for you at https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20279559