Unix count distinct lines file
Linux Commands. SunOS Commands. FreeBSD Commands. Full Man Repository. Advanced Search. Contact Us. Forum Rules. Mark Forums Read. Thread Tools. View Public Profile for Ariean. Find all posts by Ariean. View Public Profile for jim mcnamara. Find all posts by jim mcnamara. View Public Profile for Ygor. Find all posts by Ygor. Show Posts. Shell Programming and Scripting.
Getting Sum, Count and Distinct Count of a file. Registered User. Join Date: Sep Hi all this is a UNIX question. I have a large flat file with millions of records.
Also, can we do the same by creating a function? Please bear in mind that the file is huge Thanks in advance. Last edited by Franklin52; at AM.. Reason: urls removed. Join Date: Feb Is there any reason to avoid external commands? Is this a homework question? Join Date: Nov Partial Solution. Hi i can solve your first 2 requirement the third i hope some one will post the solution Join Date: Jun Code :. Join Date: Jan Are you people stupid?
The forum moderator asked if this was a homework question but then you go and post the solution. These examples are just to let you know that there are multiple ways to count the lines without using "wc -l".
But if asked I will always use "wc -l" instead of these options as it is way too easy to remember. Along with the above commands, its good to know some rarely used commands to find the line count in a file. Use the nl command line numbering filter to get each line numbered. The syntax for the command is:. Not so direct way to get line count.
0コメント