白色空间! [英] White Space!

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

问题描述

有没有办法删除字段中的所有空格?


我一直在使用查找和替换 - 寻找2或3或4或10个空格

并将其替换为none。我不想替换单个空格,那些

是单词之间的空格。但是,这些领域的大部分内容已经从在线表格中剪下来了,结果可能非常分散。如果我能摆脱额外的白色

空间,我可以节省80%的空间。


它包含html标签,所以无论如何都浪费了多个空间。


有没有办法删除行的末尾mark (不管是什么,这将是b $ b!),所以线条可以连续吗?并删除任意数量的空间

大于1个空格?


我知道如果你在一个开头找到并替换1或2个空格

字段,实际上有8个空格,程序将再次通过它

再次,一次1或2,直到没有更多的空格。但是那个

似乎无法解决我的问题。


任何帮助都将不胜感激!哦,我正在使用Access 2000.


谢谢,吉尔〜

Is there a way to remove all the white space in the fields?

I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces
and replacing them with none. I don''t want to replace single spaces, those
are the spaces between the words. But most of what is in the fields has been
cut-n-pasted from online forms, and the results can be VERY spread out. I
could probably save 80% of the space if I could get rid of the extra white
space.

It contains html tags, so anything more than one space is wasted anyway.

Is there a way to remove the end of the line "mark" (whatever that would
be!), so the lines can be continuous? And to remove any amount of spaces
larger than 1 space?

I know that if you find and replace like 1 or 2 spaces at the beginning of a
field, and there are actually 8 spaces, the program will go through it again
and again, that 1 or 2 at a time, until there are no more spaces. But that
doesn''t seem to work with my problem.

Any help would be appreciated! Oh, and I''m using Access 2000.

Thanks, Jill~

推荐答案

你们做VBA代码?当然可以编写将要通过的代码来消除多余的空间。在HTML中,< BRmarkup意味着

打破一个新行,但它不是唯一的标记。


如果你有一个最新版本的Access,请检查替换

函数的帮助...替换两个空格 " 有一个空间 " ;.如果您有早期版本的
,请在此新闻组的档案中搜索许多

过程/函数中的一个,这些过程/函数将一行字符替换为另一个字符串。

您可以在更新查询中使用它来一次清理多个字段。


Larry Linson

Microsoft Access MVP


" JA" < ja ***** @ kc.rr.com在留言中写道

news:t4 ************ @ tornado.rdc-kc.rr.com。 ..
Do you do VBA code? It would certainly be possible to write code that would
go through and eliminate the extra spaces. In HTML, a <BRmarkup means
break to a new line, but it''s not the only markup that does.

If you have a recent version of Access, check Help on the Replace
function... for replacing two spaces " " with one space " ". If you have
an earlier version, search the archives of this newsgroup for one of many
procedures/functions that replaced one string of characters with another.
You can use it in an Update Query to clean up multiple Fields at a time.

Larry Linson
Microsoft Access MVP

"JA" <ja*****@kc.rr.comwrote in message
news:t4************@tornado.rdc-kc.rr.com...

有没有办法删除字段中的所有空格?


我一直在使用Find-并且 - 替换 - 寻找2或3或4或10个空格

并将其替换为无。我不想替换单个空格,那些

是单词之间的空格。但是大部分领域的内容已经从网上表格中粘贴了,并且结果可能非常普遍

out。我可以节省80%的空间,如果我可以摆脱

额外的空白区域。


它包含html标签,所以不止一个无论如何都浪费了空间。


有没有办法删除行的末尾mark (不管是什么,这将是b $ b!),所以线条可以连续吗?并删除任意数量的空间

大于1个空格?


我知道如果你在<1或2个空格处找到并替换< br $>
a字段,实际上有8个空格,程序将一次又一次地通过它

,一次一个或两个,直到没有空格。

但这似乎与我的问题无关。


任何帮助都将不胜感激!哦,我正在使用Access 2000.


谢谢,吉尔〜
Is there a way to remove all the white space in the fields?

I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces
and replacing them with none. I don''t want to replace single spaces, those
are the spaces between the words. But most of what is in the fields has
been cut-n-pasted from online forms, and the results can be VERY spread
out. I could probably save 80% of the space if I could get rid of the
extra white space.

It contains html tags, so anything more than one space is wasted anyway.

Is there a way to remove the end of the line "mark" (whatever that would
be!), so the lines can be continuous? And to remove any amount of spaces
larger than 1 space?

I know that if you find and replace like 1 or 2 spaces at the beginning of
a field, and there are actually 8 spaces, the program will go through it
again and again, that 1 or 2 at a time, until there are no more spaces.
But that doesn''t seem to work with my problem.

Any help would be appreciated! Oh, and I''m using Access 2000.

Thanks, Jill~



JA写道:
JA wrote:

有没有办法删除字段中的所有空格?


我一直在使用Find - 并且替换 - 寻找2或3或4或10个空格

并替换为none。我不想替换单个空格,那些

是单词之间的空格。但是,这些领域的大部分内容已经从在线表格中剪下来了,结果可能非常分散。如果我能摆脱额外的白色

空间,我可以节省80%的空间。


它包含html标签,所以无论如何都浪费了多个空间。


有没有办法删除行的末尾mark (不管是什么,这将是b $ b!),所以线条可以连续吗?并删除任意数量的空间

大于1个空格?


我知道如果你在一个开头找到并替换1或2个空格

字段,实际上有8个空格,程序将再次通过它

再次,一次1或2,直到没有更多的空格。但那个

似乎无法解决我的问题。
Is there a way to remove all the white space in the fields?

I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces
and replacing them with none. I don''t want to replace single spaces, those
are the spaces between the words. But most of what is in the fields has been
cut-n-pasted from online forms, and the results can be VERY spread out. I
could probably save 80% of the space if I could get rid of the extra white
space.

It contains html tags, so anything more than one space is wasted anyway.

Is there a way to remove the end of the line "mark" (whatever that would
be!), so the lines can be continuous? And to remove any amount of spaces
larger than 1 space?

I know that if you find and replace like 1 or 2 spaces at the beginning of a
field, and there are actually 8 spaces, the program will go through it again
and again, that 1 or 2 at a time, until there are no more spaces. But that
doesn''t seem to work with my problem.



您可以编写查询来进行文本替换,或者您可以编写代码

来打开每个表,查看每个文本字段和修改它。无论哪种方式

你需要一个函数来取原值并返回清理后的

值。


" ;标记"你指的可能是一个ASCII 160.这可以在HTML

代码中找到,作为一些浏览器支持的不间断空格(& nbsp;或)。


如果您在浏览器中查看此内容,则此处是不间断的空间:

(& amp; nbsp;或& amp;#160;)

http://webdesign.about.com/library/bl_htmlcodes.htm
http://en.wikipedia.org/wiki/ Charact ... odings_in_HTML


可以修改以下代码以删除这些字符。


这里有几个可能起点。向Substitute()过程中的原始

作者致歉;没有迹象表明它是谁。


?替代(这是一个很好的例子。,,,)

这是一个很好的例子。


代码:


''支持使用负数来获取sTextToReplace的计数从

开始右边

''侧sFullText。例如:

''

''打印替代品(这是一个测试,是,是是)

''是一个测试

''打印替代品(这是一个测试,是,是,1)

' 'thare是一个测试

''打印替代品(这是一个测试,是,是,2)

''这是测试

''打印替换(这是测试,是,是,-1)

''这是测试

''打印替代品(这是一个测试,是,是, - 2)

''是一个测试

公共函数替换(sFullText As String,_

sTextToReplace As String,_

sReplacementText As String,_

可选nOccurence As Long)as String


Dim nLocation As Long,nCount As Long


Substitute = vbNullString


如果Len(sFullText)= 0或Len(sTextToReplace)= 0那么

退出函数

结束如果


nCount = 1


如果nOccurence> = 0那么

nLocation = InStr(sFullText,sTextToReplace)

ElseIf nOccurence< 0然后

nLocation = InStrRev(sFullText,sTextToReplace)

结束如果


做nLocation 0


如果nOccurence = 0那么

sFullText =左

You could write queries to do the text replacement or you could write code
to open up each table, look at each text field and modify it. Either way
you''ll need a function to take the original value and return the cleaned
value.

The "mark" you are referring to might be an ASCII 160. This is found in HTML
code as the non-breaking space ( &nbsp; or   ) that some browsers support.

If you are viewing this in a browser then here is the non-breaking space:
( &amp;nbsp; or &amp;#160; )

http://webdesign.about.com/library/bl_htmlcodes.htm
http://en.wikipedia.org/wiki/Charact...odings_in_HTML

The code below can be modified to remove those characters.

Here are a couple of possible starting points. Apologies to the original
author on the Substitute() proc; no indication of who it was.

? Substitute("this is a good example."," ", " ")
this is a good example.

Code:

'' supports using a negative number to get the count of the sTextToReplace starting from
the right
'' side of sFullText. Examples are:
''
'' Print Substitute("this is a test", "is", "are")
'' thare are a test
'' Print Substitute("this is a test", "is", "are", 1)
'' thare is a test
'' Print Substitute("this is a test", "is", "are", 2)
'' this are a test
'' Print Substitute("this is a test", "is", "are", -1)
'' this are a test
'' Print Substitute("this is a test", "is", "are", -2)
'' thare is a test
Public Function Substitute(sFullText As String, _
sTextToReplace As String, _
sReplacementText As String, _
Optional nOccurence As Long) As String

Dim nLocation As Long, nCount As Long

Substitute = vbNullString

If Len(sFullText) = 0 Or Len(sTextToReplace) = 0 Then
Exit Function
End If

nCount = 1

If nOccurence >= 0 Then
nLocation = InStr(sFullText, sTextToReplace)
ElseIf nOccurence < 0 Then
nLocation = InStrRev(sFullText, sTextToReplace)
End If

Do While nLocation 0

If nOccurence = 0 Then
sFullText = Left


(sFullText,nLocation - 1)& sReplacementText& _

Mid
(sFullText, nLocation - 1) & sReplacementText & _
Mid


这篇关于白色空间!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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