文本中特定字符的计数 [英] Count of specific character in a text

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

问题描述

我有一个文本列表,我需要找出每个角色出现的次数。


文本中的示例76DC4-34角色4出现两次。是否有一个查询,对于这个实例,如果我提供文字和字符我正在寻找它将给出结果的数量或如果没有这样的查询我如何得到我想要的结果?


我假设我将不得不重复一个过程36次(每个数字10个,每个字母26个,文本中的其他字符无关紧要)

I have a list of texts and I need to find out the number of times each character shows up.

Example in the text "76DC4-34" the character ''4'' shows up twice. Is there a query that for this instance if I provide the text and character I''m looking for it will give the number of occurences as a result or if there is no such query how do I go about getting the result I want?

I assume I''m going to have to repeat a process 36 times (10 for each numeric digit and 26 for each letter, other characters in the text don''t matter)

推荐答案

@shahaba


我认为没有一种简单的方法来做你所描述的,但是以下功能应该指向正确的方向。它将计算传递给它的String中包含的每个Number的出现总数:
@shahaba
I do not think that there is an easy Method of doing what you describe, but the following Function should point you in the right direction. It will count the Total Number of occurrences of each Number contained within the String passed to it:
展开 | 选择 | Wrap < span class =codeDivider> | 行号


这里是功能更紧凑。它使用 Replace()函数,因此您必须使用Access 2000或更高版本才能工作。它涵盖了您指定的所有内容, 0-9 A -Z

Here''s a function that is a little more compact. It uses the Replace() function, so you''ll have to be using Access 2000 or later for it to work. It covers everything you''ve specified, 0-9 and A -Z.

展开 | 选择 | Wrap | 行号


Linq,那太棒了!
Linq, that''s brilliant!


这篇关于文本中特定字符的计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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