It is possible, but not as easy as sorting with SQL.
In fact, SQL makes it SO much easier to sort, write new records, update existing records, compare dates or strings...unless there's some compelling reason to keep the data in CSV format (and their often is), I'd probably put it in a DB table and work with it that way.
Now, sorting the CSV data.
This is probably going to require that you retrieve the contents of the CSV file into a large multi-dimensional array representing your spreadsheet.
In pseudo-code:
create an array $data to hold the data
open the file
loop through the rows
add the fields in each row to a new element in $data
So, you'll have:
$data[0] = array('field1' => 'value1', 'field2' => 'value2', etc);
$data[1] = array('field1' => 'value1', 'field2' => 'value2', etc);
$data[2] = array('field1' => 'value1', 'field2' => 'value2', etc);
... and so on.
Now, you need to sort that array based on the contents of field1 or field2, right?
This is done with PHP's usort() function. This is an extremely useful and handy function that seems fairly rarely used, if the code I review/modify is any indication. Look at the examples for it's usage.
Basically, you'll write a small comparison function, then use that as a callback in usort. It's simpler than it sounds, as the usage examples make clear.
Once your array is sorted, you can print your output.