How to sort .csv file and save the sorted to a file?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ghost24
Newbie
Posts: 9
Joined: Mon Oct 22, 2012 11:51 pm

How to sort .csv file and save the sorted to a file?

Post by ghost24 » Tue Jan 29, 2013 12:52 am

Hi,

i have a .csv file and will sort it, Any idea how?
i think with the array function, but i dont know how!

I have the following csv file with
id'value (here the value is a time)

i will sort it for the value (time)

********************
that i have:
********************
1'01:57:00
2'02:00:00
3'01:57:00
4'03:00:00
5'01:57:00
6'04:00:00
********************

********************
after sort i must have:
********************
1'01:57:00
3'01:57:00
5'01:57:00
2'02:00:00
4'03:00:00
6'04:00:00
********************

I can use another delimiter symbol like ' to need so.
And at the output file it is unimportant.
All this one are ok at the output file:
1. 01:57:00
or
1 01:57:00
or
1 - 01:57:00
or
1'01:57:00
or
and so on

For the number (how many) of the id´s, i have a variable that i can import... here it is 6

and after the sort, i must write the information into a file... like test.txt ore.....


Any one any idea?

I think, its easy.. but for me... its the horror.
I think i must learn to work with array´s.. but no time at the moment to do this intensive.

I hope you can help me!

thanks a lot!

PS sorry about my bad english

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Tue Jan 29, 2013 1:21 am

hi ghost,

This might help you :

http://www.mjtnet.com/forum/viewtopic.php?t=4063
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts