Redian新闻
>
Ask an interveiw question: finding phone number
avatar
Ask an interveiw question: finding phone number# JobHunting - 待字闺中
w*i
1
谁现在还喝豆浆粉泡的豆浆?说起这事能笑掉大牙。这种饮料我都十几年没见过了,真是没想到,竟然出现在楼下新开的餐馆里。具体名字我就不说了,说了到时候老板再上来喷我。
现在说说这个恶心到极端的餐厅。应该是前两个月才开始营业的,话说营业当天人真多呀,乌压压的一大片,正好距离理想国际大厦特别近,来的没有一个不是上班族,趁着中午休息的空儿,出来遛食来了。一看,哇,新店,还这么多人,而且满18赠5块,不错的实惠。中国人不就这样吗,哪里热闹就都往哪钻。
所以我也不是圣人,我那天也带着同事去了,找了半天找一个凳子,点个面最便宜的18。真是贵到家,你一定觉得这是个拉面或者什么,不是,所谓的面呢,那么一小团,跟超市里买的那种没有区别,估计去沙县小吃也就6块钱吧。
本来想吃个普通包子,结果服务员给拿错了,给的是紫薯包,我吃了一口就吃不下去了,实在甜的渗人,都不知道里面加了什么。然后想点个热饮,结果说没有,只有豆浆是热的。我当时就想,行啊,豆浆也行,结果上来之后,没喝半口,差点吐出来,竟然是豆浆粉泡的。我估计你就是给老头老太太喝,他们都不喝,现在谁家里没有台豆浆机啊。
反正自那后打死都不去了。现在路过看见中午最多也就2人,晚上连个人影都没有,就这一大餐厅,养活一堆服务员吧,我看照这样下去,迟早就关门,真亏了这豪华的装修了。
avatar
a*r
2
There are many large files, how to fast find the phone numbers from these
files? Phone number has two formats:
0123456789
012 345 6789
He gives examples of file in google document:
File 1:
From: s***[email protected]
To: b*[email protected]
Subject: Request #12365712
Date: Fri, 2 Sep 2011 10:34:83
Hi Bob
You can contact our sales department on 9379273429 or our marketing
department on 038 739 7392.
Regards
Jenny
File 2:

ACME consulting

Contact information:


Enquires: 187 834 9382

In examples above:
How do you find phone numbers: 9379273429, 038 739 7392, 187 834 9382?
请大牛指点一下吧, 多谢!!!
avatar
g*g
3
1.Write a small project
Open folder and Open every file.
You can think and set all the conditions about phone number.
In this case, i would like to set phone number format as follows.
FIRST OF ALL, DELTE SPACE, THUS , USE REPLACE method.
Then , replace all the '-', then replace all the '(', then replace all the '
)',
Okay, then use indexof , might be instr, to find 0123456789.
And if found, keep folder path and file name to save into file by using
streamwriter class.
2. the file looks like EMAIL;
Thus, you should can import into outlook. And using outlook's search
function, search title, content, from, to . then find all the files
including this phone number.
avatar
c*p
4
用个状态机就行了吧。。

【在 a********r 的大作中提到】
: There are many large files, how to fast find the phone numbers from these
: files? Phone number has two formats:
: 0123456789
: 012 345 6789
: He gives examples of file in google document:
: File 1:
: From: s***[email protected]
: To: b*[email protected]
: Subject: Request #12365712
: Date: Fri, 2 Sep 2011 10:34:83

avatar
a*r
5
能展开讲讲吗?多谢了

【在 c****p 的大作中提到】
: 用个状态机就行了吧。。
avatar
a*r
6
Thanks for your reply.
I think he just want to filter out the phone number from other text in the
file instead of seaching a specific phone number. The file format could be
any type, not limited to email or html ...

'

【在 g*********g 的大作中提到】
: 1.Write a small project
: Open folder and Open every file.
: You can think and set all the conditions about phone number.
: In this case, i would like to set phone number format as follows.
: FIRST OF ALL, DELTE SPACE, THUS , USE REPLACE method.
: Then , replace all the '-', then replace all the '(', then replace all the '
: )',
: Okay, then use indexof , might be instr, to find 0123456789.
: And if found, keep folder path and file name to save into file by using
: streamwriter class.

avatar
g*x
7
regular expression will do the trick
grep "(\d{10})|(\d{3}[ ]\d{3}[ ]\d{4})" /files
avatar
S*n
8
我也支持状态机的解法。
就是画一个DFA(Deterministic Finite Automata)的图,然后状态机的代码就自然写
出来了。
几乎一模一样题,我以前学compiler的时候,是第一个星期的家庭作业:三种类型的电
话号码
1234567890
123-456-7890
(123)456-7890
不过当时跟你这个有个不同的是,我们没要求考虑“很多”的“大”的文件。不知道你
是不是还要考虑这方面。

【在 a********r 的大作中提到】
: 能展开讲讲吗?多谢了
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。