Hey Jean Jourdain!

I’ve installed xsv and let it work with my 57MB CSV-file… and it prompt found 
the same error where BBEdit had also problems:

—

Vlad@MAC-V14157-QL909QJ73J ~ % xsv sort 
--select="MSGNO,ADRC_COUNTRY,ADRC_REGION,ADRC_POST_CODE1,ADRC_CITY1,ADRC_CITY2,ADRC_STREET,ADRC_HOUSE_NUM1"
 --delimiter=";" --output="/Users/Vlad/Desktop/2025-03-24 BAG - PEO - manuell - 
sorted.csv" "/Users/Vlad/Desktop/2025-03-24 BAG - PEO - manuell.csv"
CSV error: record 25816 (line: 25816, byte: 6673969): found record with 12 
fields, but the previous record has 36 fields
Vlad@MAC-V14157-QL909QJ73J ~ %

—

It looks like I should better take care of the CSV-file BEFORE bothering the 
whole world about my CSV-problems… 😉

Nevertheless xsv looks nice and - after massaging my CSV-file! - I’ll give it a 
chance. I have A LOT of CSV-files I work with.

Thanks again!


Regards,
Vlad




> Am 26.03.2025 um 18:08 schrieb jj <[email protected]>:
> 
> Vlad,
> 
> You could use some command line utility like xsv  
> (https://github.com/BurntSushi/xsv)
> 
> Install it with homebrew in the terminal:
> 
>     $ brew install xsv
>     
> and then:
>     
>     $ xsv sort 
> --select="MSGNO,ADRC_COUNTRY,ADRC_REGION,ADRC_POST_CODE1,ADRC_CITY1,ADRC_CITY2,ADRC_STREET,ADRC_HOUSE_NUM1"
>  --delimiter=";" --output="/path/to/some-sorted.csv" "/path/to/some.csv"
> 
> HTH,
> 
> Jean Jourdain
> On Wednesday, March 26, 2025 at 4:04:35 PM UTC+1 Bruce Van Allen wrote:
>> Another way staying in BBEdit would be to do some neutralizing 
>> conversions before parsing into columns.
>> 
>> For example, when I need to embed newlines in a file of text records 
>> whose records are separated by newlines, I replace the internal newlines 
>> with another character that isn’t already in the records somewhere - 
>> such as a backslash (‘\’). It looks like your records all start with 
>> ‘200' and end with two consecutive semi-colons (‘;;’). If so, then you 
>> could search for newlines NOT surrounded by those.
>> 
>> When I do this I take a step and then save a copy of the file before 
>> moving to the next cleanup step. Always want to be able to back up a 
>> step or two if I goof.
>> 
>> [Sorry about the stupid smart quotes my new email client insists on 
>> converting from straight quotes.]
>> 
>> HTH
>> 
>> ------ Original Message ------
>> From "Marshall Clow" <[email protected] <>>
>> To [email protected] <>
>> Date 3/26/2025 7:41:47 AM
>> Subject Re: How to filter / sort CSV-files by certain columns?
>> 
>> >On Mar 26, 2025, at 7:25 AM, Vlad Ghitulescu <[email protected] 
>> ><http://ghitulescu.de/>> 
>> >wrote:
>> >>
>> >>You’re probably right re BBEdit vs other special tools - even Rich 
>> >>suggested this in the beginning of our conversation.
>> >>
>> >>The question is: Which other tool exactly?
>> >>
>> >>Excel would not import 3 million+ records 😔 and yes, I encountered 
>> >>the „helpful“ changes and some more too 😶
>> >>
>> >>The Perl-CSV family of modules sounds like heaven 😉 - unfortunately I 
>> >>didn’t learn Perl yet 😶
>> >
>> >I have done stuff with the ’csv’ module in python 3, but nothing this 
>> >extensive.
>> > https://docs.python.org/3/library/csv.html
>> >
>> >— Marshall
>> >
>> >
>> 
>> 
>> Thanks,
>> 
>> - Bruce
>> 
>> _bruce__van_allen__santa_cruz__ca_
>> 
>> 
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or believe that the application isn't working correctly, please email 
> "[email protected] <mailto:[email protected]>" rather than posting 
> here. Follow @bbedit on Mastodon: <https://mastodon.social/@bbedit>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion visit 
> https://groups.google.com/d/msgid/bbedit/8d1058a2-37d1-4262-bfdd-1a12f952c9e2n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/bbedit/8d1058a2-37d1-4262-bfdd-1a12f952c9e2n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"[email protected]" rather than posting here. Follow @bbedit on Mastodon: 
<https://mastodon.social/@bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/bbedit/4D1F8577-4E15-4D99-AD47-79BB89907556%40Ghitulescu.de.

Reply via email to