Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 03/13/2013 10:38 PM, David Gulley wrote:
Hi,

I'm having a bit of a problem sorting records in a CSV file using
LibreOffice Calc.

I have a CSV file that contains information about ethnic media
organizations. The file contains 3 columns: company ID#, company name, and
ethnicities. The first field contains an alphanumeric 6 to 8 digit string.
The second field contains a plain text string which may occasionally
contain fancy symbols. The third field contains a list of ethnicities
relevant to the organization, delimited by double percent signs (%%). Here
is an example record:

70f9d2,Acme Inc.,Mexican%%Chinese

I have been trying to sort this file by selecting everything and clicking
"Data" -> "Sort..." When the sort dialog comes up I select column A and
column B as sort keys 1 and 2, respectively. In the options tab, I am
checking the box next to "Range contains column labels" because my file
does include a header column.

I am getting very strange results when I try to execute the sort. For some
reason, a large number of records are disappearing as a result of the sort.
I am saving a separate file containing the sorted version of the records.
See command log below comparing the line count of both the original and
sorted versions:

$ wc -l company-ethnicities.csv
    55261 company-ethnicities.csv
$ wc -l company-ethnicities-sorted.csv
    30815 company-ethnicities-sorted.csv

A whopping 24446 records are being deleted somehow... why is this? Does
LibreOffice Calc's sort feature also remove duplicates?

FYI: The reason I am not using the sort shell command instead is because it
is also giving me problems (for some reason it's mangling the CSV file and
putting a ton of records into a single field.... and yes, I did try setting
LC_ALL to C)

Does anyone know what might be causing this? I appreciate any help I can
get on this one.

Thanks.

David,

I have not seen this when sorting.

Have you tired saving the file as ods and then sort it?

--
Jay Lozier
jslozier@gmail.com


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.