非重复行数-唯一计数 [英] Number of non repeating lines - unique count

查看:96
本文介绍了非重复行数-唯一计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的问题:从标准输入中可以输入任意行的文本. 输出:非重复行数

Here is my problem: Any number of lines of text is given from standard input. Output: number of non repeating lines

输入:

She is wearing black shoes.
My name is Johny.
I hate mondays.
My name is Johny.
I don't understand you.
She is wearing black shoes.

输出:

2

推荐答案

您可以尝试使用uniq man uniq并执行以下操作

You could try using uniq man uniq and do the following

sort file | uniq -u | wc -l

这篇关于非重复行数-唯一计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆