Sorting a csv

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hi,

I have a csv that has around 250,000 rows. I have an excel macro that reads
data from the csv, but it expects the csv to be sorted. So I want to sort
the csv file using excel, (I could sort in access and export but this would
not be automated) I want the process automated.

Since the csv is 250,000 rows I cannot open it in excel and sort, because I
have excel 2003 it has a maximum row of 65,000. Does anyone know how to do
this, I tried looking online but could find nothing.

Thanks
 
Jeff said:
Hi,

I have a csv that has around 250,000 rows. I have an excel macro that reads
data from the csv, but it expects the csv to be sorted. So I want to sort
the csv file using excel, (I could sort in access and export but this would
not be automated) I want the process automated.

Since the csv is 250,000 rows I cannot open it in excel and sort, because I
have excel 2003 it has a maximum row of 65,000. Does anyone know how to do
this, I tried looking online but could find nothing.

Thanks
You may be able to sort a csv file using the "sort" command prompt. Type
sort /? at a command prompt for help. Not sure if this will handle
250,000 rows.
Other choice is to upgrade to Excel 2007 or use Quattro Pro, which allow
1,000,000 rows.

Bill
 
Microsoft has a macro here:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q120596

which enables you to import files with more than 65k rows - they get
put into separate sheets. You could then sort each sheet.

But, you would then need another macro to carry out a merge sort from
the 4 sheets and to produce your text file, as saving in csv format
from Excel will be limited to a single sheet.

Given that you will need macros to automate all this, wouldn't Access
be a better tool to use anyway? Try posting in one of the Access
groups.

Hope this helps.

Pete
 
Back
Top