Converting huge ASCII file to flat and convert
When using a databse to sort the data one needs to know the structure of the data. In other words, there must be a field delimiter and a row delimiter. 
Then you can import the file into a SQL-table and index it and sort it the way you want. Importing flat files is easy done with tools provided by any Database Engine, for example SQL Server Integration Services (SSIS) or MySQL LOAD.