A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Windows 10 » Windows 10 Help Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Finding first field duplicate lines in a sorted text file without uniq or awk or col using only vim - is it possible?



 
 
Thread Tools Rate Thread Display Modes
  #16  
Old June 17th 19, 02:58 PM posted to alt.os.linux,alt.comp.os.windows-10,alt.comp.freeware
owl
external usenet poster
 
Posts: 50
Default Finding first field duplicate lines in a sorted text file without uniq or awk or col using only vim - is it possible?

In alt.os.linux Arlen G. Holder wrote:

Did you already have that available, or did you expressly code it to
resolve the problem set?


I did not have it already. I tackled it as an exercise.


I'm curious, if you wrote that script, did you hand do it first inside of
VIM and then copied the hand code to the script? It's the most involved vim
script I've ever seen, which is why I ask.


Yes. I did the macro first as a series of commands in vim, then put
those commands into a register. The function stuff that controls the
running of the macro was of course done separately.

Ads
  #17  
Old June 17th 19, 08:28 PM posted to alt.os.linux,alt.comp.os.windows-10,alt.comp.freeware
Arlen G. Holder
external usenet poster
 
Posts: 236
Default Finding first field duplicate lines in a sorted text file without uniq or awk or col using only vim - is it possible?

On Mon, 17 Jun 2019 13:58:38 +0000 (UTC), owl wrote:

I did the macro first as a series of commands in vim, then put
those commands into a register. The function stuff that controls the
running of the macro was of course done separately.


Hi owl,
That makes sense that you tried it as a series of commands in VIM.

So that your script is leveraged to as many people as possible,
I posted it yesterday to the other Windows newsgroups, namely:
o Windows XP http://tinyurl.com/windowsxp-general
https://groups.google.com/forum/#!topic/microsoft.public.windowsxp.general/sJmie_RGTow
o Windows 7 http://tinyurl.com/alt-windows7.general


I did not have it already. I tackled it as an exercise.


Ah. Wow. That's very helpful of you.
I, for one, am appreciative - since it "seems" easy - but it's not.

I very much THANK YOU for coding that example, which is the whole point of
Usenet, which is for everyone to bring what they can of value to share.

I will state that I have searched the net, ad infinitum, and have NEVER yet
found a solution to the stated problem set until you coded this up for us!
https://stackoverflow.com/questions/1915636/is-there-a-way-to-uniq-by-column
https://stackoverflow.com/questions/22849757/how-to-delete-duplicated-rows-based-in-a-column-value
https://unix.stackexchange.com/questions/104525/sort-based-on-the-third-column
https://stackoverflow.com/questions/17847799/sort-and-remove-duplicates-based-on-column
https://superuser.com/questions/416134/how-can-i-sort-objects-by-third-column-in-powershell
https://www.biostars.org/p/271720/
https://unix.stackexchange.com/questions/77406/sort-only-on-the-second-column
https://unix.stackexchange.com/questions/171091/remove-lines-based-on-duplicates-within-one-column-without-sort
https://www.unix.com/shell-programming-and-scripting/179059-remove-duplicate-lines-based-field-sort.html
https://stackoverflow.com/questions/17847799/sort-and-remove-duplicates-based-on-column
https://stackoverflow.com/questions/33265934/duplicates-in-an-unix-text-file-based-on-multiple-fields
https://superuser.com/questions/332268/windows-7-sorting-contents-of-a-file/332269
https://stackoverflow.com/questions/22306490/how-to-sort-csv-by-columns-using-batch-scripting
https://stackoverflow.com/questions/12850909/how-to-remove-duplicates-in-a-csv-file-based-on-two-columns
https://stackoverflow.com/questions/1450085/list-only-duplicate-lines-based-on-one-column-from-a-semi-colon-delimited-file
https://stackoverflow.com/questions/6438896/sorting-data-based-on-second-column-of-a-file
https://www.mathworks.com/matlabcentral/answers/278956-sort-matrix-based-on-unique-values-in-one-column
https://www.ultraedit.com/support/tutorials-power-tips/ultraedit/advanced-column-based-sort.html
etc.

This solution of yours is a KEEPER for sure!
o Thank you for bringing value to the Usenet potluck to share with all!
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 10:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.