Re: Sorting CSV string and removing Duplicates - Mailing list pgsql-general

From Yves Dorfsman
Subject Re: Sorting CSV string and removing Duplicates
Date
Msg-id 55B68DCF.3030603@zioup.com
Whole thread Raw
In response to Sorting CSV string and removing Duplicates  (Alex Magnum <magnum11200@gmail.com>)
List pgsql-general
>
> I have a csv string in a text field that is unsorted and contains duplicates.
> Is there a simple way to remove these and sort the string.
>
> E.g
> 2,18,20,23,1,27,1,2,8,16,17,18,20,22,23,27
>

Do you need to eventually load the data in Postgres?

I'd personally use python to deal with this, we're talking 4 or 5 lines here,
if even. I suspect you can do the same with perl or ruby or whatever is your
weapon of choice.

How columns does your csv file has? Is it a one-line file?

--
http://yves.zioup.com
gpg: 4096R/32B0F416



pgsql-general by date:

Previous
From: dinesh kumar
Date:
Subject: Re: Sorting CSV string and removing Duplicates
Next
From: Chris Mair
Date:
Subject: Re: Sorting CSV string and removing Duplicates