如何解决这个问题 [英] how to resolve this problem

查看:135
本文介绍了如何解决这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有一个问题:在input.txt这样的输入文件中读取,识别

英文单词。输出

a按字母和数字列出的单词把每个单词分成一个

文件,比如output.txt

例如input.txt是:


Hello world。

大家好。

我们走吧。

和output.txt是:

每一个,1

go,1

你好,2

让,1

一,1

us,1

world,1

我记得有些书有答案,但我不记得

的名字这本书


尊重

解决方案

cat file1 | tr -s"。,; =" " \\\
" |排序| uniq -c | sort -n +0 -r

blockquote>

是否有这个问题的源代码,或者我能找到的任何地方

你写道:

cat file1 | tr -s"。,; =" " \\\
" |排序| uniq -c | sort -n +0 -r




没有你手动尝试(即通过你的技能)


here is the question:read in a input file such like input.txt,recognise
the english words.output
a list of the words by alphabet and the count of the each word into a
file such like output.txt
e.g.the input.txt is:

Hello world.
Hello every one.
Let us go.
and the output.txt is:
every,1
go,1
hello,2
let,1
one,1
us,1
world,1
I remember some book has the answer ,but i can''t remember the name of
the book

regardly

解决方案

cat file1 | tr -s ".,;= " "\n" | sort | uniq -c | sort -n +0 -r


is there source code for this problem,or anywhere i can find
ye wrote:

cat file1 | tr -s ".,;= " "\n" | sort | uniq -c | sort -n +0 -r




No u have try by manually(i.e by your skill)


这篇关于如何解决这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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