跪求大侠,我实在是搞不定了.请你们帮忙啊!!!!多谢了!!!..
请大侠指点迷津!
我想对一个文件夹下的所有文件进行固定字符长度的回车.(30个汉字的长度)
在整理完长度后把里面的空格行全都删除掉.再保存,原文件名不变.
应该怎么做啊?
多谢啦!!!!!!!!!!!!
我只找到了下面这个程序只能执行一个文件,而且还不能保存.
@echo off
for /f "delims=" %%a in (yourtext.txt) do (
set var=%%a
setlocal enabledelayedexpansion
set var=!var: =!
if not "!var!"=="" set var=!var: =!
if not "!var!"=="" echo !var!
endlocal
)
pause
我要处理的范文如下 :
8、 I Apologize.
我很抱歉。
A: Jessie, I’m afraid I can’t come back home for dinner tonight.
杰茜,我恐怕今晚不能回家吃晚饭了。
B: Not back home for dinner again? That’s the third time this week!
又不回家吃晚饭?这个星期你已经是第三次了这样了!
A: I’m sorry. Our company has just opened. There are always too many things to handle. You know that.
对不起。我们的公司刚刚开业,总是有太多事情要处理,这你是知道的。
B: You don’t have to explain. Suit yourself.
你不必解释了。随便你。
A: I apologize. You have my word, I’ll spend some time with you on the weekend. I promise.
很抱歉。我向你保证,周末抽时间来陪你。我发誓。
B: We’ll see.
再说吧。
A: Thank you for understanding. I promise I’ll make it up to you.
谢谢你能理解。我保证一定给你补上。
A: Sam, you’ve got to forgive me.
山姆,你得原谅我。
B: Forgive you for what?
原谅你什么?
A: I used your computer. And I’m afraid I’ve erased your personal files accidentally.
我用了你的电脑。恐怕我不小心把你的私人文件删掉了。
B: No! Are you kidding me?
不!你跟我开玩笑?
A: I’m afraid not. I apologize.
不是。我很抱歉。
B: I can’t believe it! I have all my important personal documents stored in that computer. It’s no laughing matter.
我简直不敢相信!我将所有重要的私人资料都存入电脑了。这可不是闹着玩的。
A: I told you I’m sorry. What can I do to make it up to you?
我都跟你道歉了。我怎样做才能弥补我的过错?
B: Well, you should be sorry! Don’t ever use my computer again! You can’t do anything now, it’s too late!
你应该道歉!再也不许用我的电脑了!现在你做什么都没有用了,已经太迟了!
谢谢各位大哥的帮助.
用了达人的这个代码处理得很好,只是不能处理汉字,英文倒是排得好好的.不知道怎么样能做成处理汉字的?就是说30个汉字的长度也换行.下面的代码该如何改善一下才能做到呢?
@echo off
::放在要处理的目录里运行
::不能处理汉字(即无论汉字或英文, 超过60个才能处理)
::注意: 非空格行不能以空格开头
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('dir /b/a-d "*.txt"') do (
type nul>temp.txt
for /f "delims=" %%m in ('type "%%i"') do (
set "str=%%m"
if "!str:~0,1!"==" " (set "str=!str: =!") else (call :cut)
)
move /y temp.txt "%%i"
)
goto :eof
:cut
set "var=%str:~0,60%"
>>temp.txt echo %var%
set str=%str:~60%
if not "%str%"=="" goto :cut
我用上面这个程序把范文处理后是这样的:
8、 I Apologize.
我很抱歉。
A: Jessie, I’m afraid I can’t come back home for dinner toni
ght.
杰茜,我恐怕今晚不能回家吃晚饭了。
B: Not back home for dinner again? That’s the third time thi
s week
又不回家吃晚饭?这个星期你已经是第三次了这样了!
A: I’m sorry. Our company has just opened. There are always
too many things to handle. You know that.
对不起。我们的公司刚刚开业,总是有太多事情要处理,这你是知道的。
B: You don’t have to explain. Suit yourself.
你不必解释了。随便你。
A: I apologize. You have my word, I’ll spend some time with
you on the weekend. I promise.
很抱歉。我向你保证,周末抽时间来陪你。我发誓。
B: We’ll see.
再说吧。
A: Thank you for understanding. I promise I’ll make it up to
you.
谢谢你能理解。我保证一定给你补上。
A: Sam, you’ve got to forgive me.
山姆,你得原谅我。
B: Forgive you for what?
原谅你什么?
A: I used your computer. And I’m afraid I’ve erased your per
sonal files accidentally.
我用了你的电脑。恐怕我不小心把你的私人文件删掉了。
B: No Are you kidding me?
不!你跟我开玩笑?
A: I’m afraid not. I apologize.
不是。我很抱歉。
B: I can’t believe it I have all my important personal docum
ents stored in that computer. It’s no laughing matter.
我简直不敢相信!我将所有重要的私人资料都存入电脑了。这可不是闹着玩的。
A: I told you I’m sorry. What can I do to make it up to you?
我都跟你道歉了。我怎样做才能弥补我的过错?
B: Well, you should be sorry You can’t do anything now, it’s
too late
你应该道歉!再也不许用我的电脑了!现在你做什么都没有用了,已经太迟了!
忘了说了,上面的范文是疯狂英语里面的一篇..希望大家帮忙,我想学好英语.
Last edited by zhengruijian on 2008-6-1 at 09:21 PM ]
Originally posted by moniuming at 2008-6-1 22:28:
弄得我头都大了(借用5楼的判断方法:):P:)),这次应该没问题了,汗.........
@echo off
for /f "delims=" %%i in ('dir /b/a-d "*.txt"') do (
type nul&g ...
我用14楼的这段代码处理了一下之后,有的文章变成这样的了.个别的句子没有处理.可能是程序不够完善吧.
PART 3:INTERMEDIATE DIALOGUES
中级对话
如果你把前一部分最基本的初级对话都掌握了的话,那就开始下一步
的跋涉——进军中级对话吧。具有中级英语水平的人,也就具备了中
级交流的能力。这一部分的对话涉及生活、工作和学习的点点滴滴,
有发生在老朋友之间的,有同学之间、亲友之间的,有发生在同事之
间的,也有上下级之间的。但不论场景如何变化,它们的共同点就是
――交流。
1. I Can’t Believe My Eyes
我简直不能相信眼前的事实
A: I can’t believe my eyes!
我简直不能相信眼前的事实!
B: Well, if it isn’t Mike Li!
这不是迈克·李吗!
A: Jim Wang! It’s nice to see you again! It’s been a long ti
me.
吉姆·王!见到你真是太高兴了!好久不见了。
B: You know, Mike, I’ve been meaning to call you for a long
time. I’m so glad I ran into you today.
迈克,你知道吗,很久以来我一直想给你打电话。真高兴今天能遇到
你。
A: Me, too. How have you been doing?
我也一样。你最近好吗?
B: Super. How about yourself?
很好。你呢?
A: Pretty good. I can’t complain.
不错,没什么可抱怨的。
B: So tell me, the last time I saw you, you were planning to
go abroad to study, weren’t you?
快说来听听,我上一次见到你的时候,你正准备去出国留学呢,是不
是?
A: Yes, I guess I was. But as it turned out, I changed my mi
nd. I decided not to go after all.
是,我想是的。但现在有了变化,我最终还是决定不去了。
B: Oh, really? But if I remember correctly, you were intent
on going to California. Whatever made you change your mind?
I thought you were accepted to Stanford.
哦,是吗?如果我没记错的话,你当时是要去加利福尼亚。是什么使
你改变主意的?我记得你是被斯坦福大学录取了。
A: Well, it’s a long story, and I don’t want to bore you wit
h all the details. But what it boils down to is that I decid
ed that going to Stanford wasn’t a very good idea. I decided
to go to Beijing University instead. I want to save my mone
y and start my own business after graduation.
说来话长。那些细节我就不赘述了。最后的结果是,我觉得去斯坦福
读书不太明智。我打算去北大。这样,把钱省下来,毕业后可以自己
开一家公司。
B: Really? That’s very interesting.
是吗?那很有趣嘛。
A: And how about you? The last time we talked, didn’t you te
ll me you were going to open your own restaurant and hotel?
你怎么样?上次我们聊的时候,你不是说要自己开个酒店吗?
B: That’s right. I was. But things turned out differently th
an I expected.
对呀,是有这么回事。但结果却和我预想的大不相同。
A: But you seemed so determined to do that. What happened?
可是你当时是决心很大的,发生了什么事呢?
B: Well, it’s very complicated, and I’m sure you don’t want
to know all the details. But as it turned out, I decided tha
t opening my restaurant just wasn’t for me. So I decided to
stay at my old job instead.
说来复杂。我知道你不愿意听详细的个中原由。但结果却是,我觉得
自己开饭店并不适合我,所以就决定留在原来的工作岗位。
A: Well, a lot sure has happened since we last saw each othe
r.
是啊,从上次见面以来,真是发生了很多事。
B: You can say that again! You know, we should try to stay i
n touch.
你说得对!我们应该尽量保持联系。
A: Yes, we should. Let’s have lunch together sometime soon.
的确应该如此。我们最近找时间吃个午饭吧。
B: That’s a good idea. I’ll call you.
这主意不错。我到时候给你打电话。
A: OK. Take care now.
好吧。多保重。
B: You, too.
你也是。
口语要素
大家会发现,对话里面出现最多的是精彩的“口语要素”,其实,日
常对话都是这些零零碎碎的“口语要素”组成的!一部英文电影又何
尝不是成千上万“口语要素”的集合呢!
★ I can’t believe my eyes! 我简直不能相信眼前的事实!
举一反三:
* I can’t believe my ears! 真是让人难以置信!
* I can’t believe what I saw! 我不相信我的眼睛!
★ It’s nice to see you again! 又见到你真是太高兴了!
★ It’s been a long time. 好久不见了。
★ I’m so glad I ran into you today. 真高兴今天能遇到你。
★ How have you been doing? 你最近好吗?
★ How about yourself? 你呢?过得好吗?
★ Pretty good./ Super. / I can’t complain. 很好。/棒极了。/没什么可抱怨的。
【经典回答】
★ I changed my mind. 我改变了主意。
★ I decided not to go after all. 我最终还是决定不去了。
★ Whatever made you change your mind? 是什么使你改变主意的?
It’s a long story. 说来话长。
You can say that again! 你说得对!
举一反三:
* You said it! 你说对了!
* I’ll say! 你说得对!
* You’re right! 你说得对!
★ I don’t want to bore you with all the details. 那些细节我就不赘述了。
★ I decided to go to Beijing University instead. 我最后决定去北大读书。
★ Really? 是吗?
★ That’s very interesting. 那很有趣嘛。
And how about you? 你怎么样?
★ What happened? 发生了什么事呢?
★ We should try to stay in touch. 我们应该尽量保持联系。
举一反三:
* We should keep in touch. 我们应该保持联系。
* We should contact each other more often. 我们应该多多联系。
* We should keep each other informed. 我们应该保持联系。
* We should get together more often. 我们应该多多联系。
Let’s have lunch together sometime soon. 我们最近找时间吃个午饭吧。
【疯狂提示】
这是一个典型的结束此类谈话的方式。如果有一个外国人到谈话的末
尾对你说出这句话,要谨记两点:第一,不要追问确切的“一起吃午
饭”的时间,第二,不要苦苦地等待那顿“不花钱的午餐”。如果对
方出于诚意,他会这样说:Let’s have lunch t
ogether next Monday, OK?
That’s a good idea. 这主意不错。
★ I’ll call you. 我到时候给你打电话。
★ Take care now. 多保重。
超级短语
run into 碰到,遇到,邂逅
turn out 结果
after all 最终;毕竟
be intent on 决心要做;对某事专心致志
boil down to 等于;归结为
a lot sure has happened 变化很大
stay in touch 保持联系
超级句型:
① Well, if it isn’t somebody! 哟,这不是某某某吗!
Well, if it isn’t Mike Li!
这不是迈克·李吗!
【疯狂提示】这是一个引起谈话的重要句型,也是扯闲话的经典开端!
② What it boils down to 简单说来
What it boils down to is that I decided that going to Stanfo
rd wasn’t a very good idea.
简单说来,我觉得去斯坦福读书不太明智。
举一反三:
* The matter of fact is that going to Stanford wasn’t a very
good idea.
事实是,我觉得去斯坦福读书不太明智。
* As it turned out, going to Stanford wasn’t a very good ide
a.
最后的结果是,我觉得去斯坦福读书不太明智。
③ I’ve been meaning to 很久以来我一直想……
I’ve been meaning to call you for a long time.
很久以来我一直想给你打电话。
【疯狂提示】这是一个掩盖粗心、健忘及忙昏了头等等过失的最好的遮羞布!这是一个既体贴又体面但又不失虚伪的句型。一定要掌握它
!