On 2018-03-30 (22:15 MDT), Mariella Scuderi <[email protected]> wrote:
>
> Hi!
> sorry of this has been discussed already but I couldn't find anything yet.
>
> I'd need to add a suffix to duplicates like:
> [FK410002_a]
> [FK410002_b]
> [FK410003_a]
> [FK410003_a]
> [FK410004_a]
> [FK410004_b]
> [FK410009_a]
> [FK410009_b]
> [FK410009_c]
> [FK410009_d]
> [FK410009_e]
> [FK410024]
> [FK410025]
> [FK410039]
> [FK410040_a]
> [FK410040_b]
the only way I can think of to do this is using awk
awk '{ printf "%8_%d, $1, !c[$1]++?:c) }'
should print all the duplicates with a digit count after (FK410002_1). It's
untested, but it should be in the ballpark.
I'm sure it's also possible in perl with 14 characters, but perl is a long way
behind me.
--
There are strange things done in the midnight sun/By the men who moil
for gold; The Arctic trails have their secret tales/That would make your
blood run cold; The Northern Lights have seen queer sights,/But the
queerest they ever did see Was the night on the marge of Lake Lebarge/
When I cremated Sam McGee
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.