473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sorting dates

I have to sort dates that are from a txt file. So readline is used. I need someone kind to help teach me or write it up. plz do message me or aim(<Screen Name Deleted by MODERATOR>)

an example of the dates would be

10/04/2005
10-4-2005
03/14/2007

44/25/2005 would be wrong, and cause an error.

thanks kind soul
Oct 3 '07 #1
4 3116
dav3
94
I have to sort dates that are from a txt file. So readline is used. I need someone kind to help teach me or write it up. plz do message me or aim(acumenred)

an example of the dates would be

10/04/2005
10-4-2005
03/14/2007

44/25/2005 would be wrong, and cause an error.

thanks kind soul
You could use substring to look at the first couple of values of the date and just compare them. If date1 > date2 insert date2 before date1.
Oct 3 '07 #2
i have a day to get this handed in, so if anyone has time, msg please, i can send you what the assignment asks exactly...
Oct 3 '07 #3
dmjpro
2,476 2GB
i have a day to get this handed in, so if anyone has time, msg please, i can send you what the assignment asks exactly...
Don't ask the Q. in PM.
Post here what problem you have, experts are here to solve you.
And one more thing post the file you have.
Then what's the problem you have please tell me in details.

Kind regards,
Dmjpro.
Oct 3 '07 #4
r035198x
13,262 8TB
i have a day to get this handed in, so if anyone has time, msg please, i can send you what the assignment asks exactly...
When you use a readLine to read the text file contents, create Date objects and store them in a TreeSet.
Oct 3 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: bissatch | last post by:
Hi, I am about to write an application that will display all pdf files in a folder and display them by file name in order of date. Is there an easy way of doing this? I was thinking about...
1
by: John Taylor | last post by:
I have a ListCtrl with 5 columns. The first 4 columns are either strings or integers, but the last column is a string in the format of MM-DD-YYYY. I searched google and also read over the...
9
by: p0wer | last post by:
Let's suppose I have this sample document: <root> <entry id="1" <date>2003-08-03</date> <param_1>5</param_1> <param_2>10</param_2> </entry> <entry id="2"> ...
17
by: Matt Kruse | last post by:
I'm looking for the best JS/CSS solution to add functionality to tables. The only browser which needs to be supported is IE5.5+, but no activeX can be used. to be able to do: - Fixed header row...
22
by: mike | last post by:
If I had a date in the format "01-Jan-05" it does not sort properly with my sort routine: function compareDate(a,b) { var date_a = new Date(a); var date_b = new Date(b); if (date_a < date_b)...
18
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are...
3
by: melanieab | last post by:
Hi, When you click on a column header to sort in ascending or descending order, numbers (and dates) aren't sorted correctly. It turns up like this: 1 10 11 2 3 4
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
5
by: Mike | last post by:
I have several datagirds that allow sorting on two date columns. The sorting works but its not showing the newest date first when I sort. For example if I have dates in my column as 01/01/2008...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.