IonicWind Software

Announcements => User Offerings => Topic started by: Brian on April 15, 2012, 09:27:54 AM

Title: Text file sorter
Post by: Brian on April 15, 2012, 09:27:54 AM
Hi,

I had the need at work the other day to sort a csv file. Could have done it with Excel, of course,
except that Excel persists in taking leading zeros off numbers, which I didn't want

So I've done my own. Pretty self-explanatory when you run it - load a file, decide whether you
want to keep the first line intact (it may be a csv header), and press Sort. Sorts either up or
down. Save sorted file when finished replaces the file you have just loaded

At the moment, each line is limited to 1024 characters but, of course, having the source
code, you can change that. Compiles as a Project

Hope this is of interest to someone,

Regards,

Brian
Title: Re: Text file sorter
Post by: billhsln on April 15, 2012, 10:09:29 AM
Very cool program.  I could have used this kind of program many times.

Just have 2 questions. 

1) Is there doc some where on the DynaStore stuff?  I looked in the IWB Doc and found nothing on it. 

2) I wonder if there might be a way to say we want to sort on something other than the first field (that might be a real problem), but I also think 99% of the time we would want to sort by the first.

And just a comment, while Excel (Micro$oft) wants to do everything for you, OpenOffice's Calc allows you to tell it which fields in a CSV file are text, which would leave the leading 0's alone.  That is how I have been sorting CSV files with leading zeros.  I need to do that for Zip Code files all the time.

Thanks for the cool program,
Bill
Title: Re: Text file sorter
Post by: Brian on April 15, 2012, 10:50:40 AM
Bill,

It's not sorting by fields - it's sorting whole lines

I'll look for some docs - the Dyna stuff was written by Fletchie ages ago

Brian
Title: Re: Text file sorter
Post by: Brian on April 15, 2012, 11:00:28 AM
Bill,

Have a look at this, it will sort on fields, and leaves the data intact:

http://www.nirsoft.net/utils/csv_file_view.html

Brian
Title: Re: Text file sorter
Post by: Bill-Bo on April 15, 2012, 02:54:31 PM
Brian, and all,

Check out CSVed 2.2.1 at http://csved.sjfrancke.nl/index.html#csved
Read the features. It's the one I use and best I've ran across.

Bill
Title: Re: Text file sorter
Post by: Brian on April 15, 2012, 03:28:45 PM
Bill-Bo,

Thanks, I've already got csved, but there's no satisfaction like "rollng your own" is there?

And it does just what I want it to do, with minimum effort when using it!

Brian
Title: Re: Text file sorter
Post by: Brian on April 16, 2012, 06:00:22 AM
Hi,

Here's the Control Pak help file, and 3 DynaStore examples - all I can find, I'm afraid

Brian