April 29, 2024, 07:45:21 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Text file sorter

Started by Brian, April 15, 2012, 09:27:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

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

billhsln

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
When all else fails, get a bigger hammer.

Brian

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

Brian

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

Bill-Bo

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

Brian

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

Brian

Hi,

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

Brian