我正在探索在转换为文本文件时使用word来“捕获格式”。
总体目标是捕获自定义文档结构和格式时,转换为文本文件。即生成一个文本文件,说(粗体)如果文本是粗体,或(下划线)如果下划线等。
根据前面的问题,这通常用于生成文本文件,将句子捕获为while(即不引入不必要的换行符),然后可以使用power query读取这些文本文件。
最终,这被证明是有用的,但我已经意识到,一个文档的结构和格式有价值的信息,到目前为止还没有捕获。
我昨天才意识到,使用word来查找和替换格式特征是可行的。在下面的图片中,我使用word来识别文本是否有下划线,并将其替换为之前的文本(HEADER)。对于大多数格式标记(如Tab),可能也可以这样做。
在大多数情况下,动态标记文本文件中的标题,然后我可以使用它在power query中创建一个函数,以迭代各种类似的文档,并开始将文本分隔为相关的部分。
话虽如此,我还是遇到了end of cell marker
,如下所示:
最初,我认为用另一个字符(|
)查找和替换这样的标记是可行的,然而,似乎不能用上述方法搜索该格式标记。
也就是说,人们似乎有一些希望使用VBA来做类似的事情,以获得Chr(13)
,这显然是它的价值,并认识到它。
我只想创建一个脚本,用某个字符标记单元格标记的每一端。
1条答案
按热度按时间bd1hkmkf1#
找到这个答案:https://answers.microsoft.com/en-us/msoffice/forum/all/add-character-before-end-of-cell-marker-in-word/2b7fe2c3-e96e-4d34-a887-b1ddf17d512f