将数据从MS Word移动到MS Excel [英] Moving data from MS Word to MS Excel

查看:160
本文介绍了将数据从MS Word移动到MS Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有MS Word中的数据记录要读入一个名为R的统计程序。问题是这些文件包含特殊字符(不是纯文本)。处理它们的过程一直是将它们以MS Word /保存的形式作为txt文档/读入MS Excel(使用导入向导为人员和对话框创建一列)/转换为.csv /读入R.过程工作但耗时。我发现如何读取具有R(R通常需要纯文本)的特殊字符的文本,但这需要文档在Excel文档中。这是可取的,因为如果我可以将特殊字符读入R中,那么一次就可以简单地排除所有的特殊字符。问题出现是因为我无法直接将MS Word文档导入到Excel中。我必须先保存它作为一个文本文件(我不介意这样做),然后读入它,这将把特殊字符转成框和问号。我需要将MS Word文档作为具有2列(个人,对话)的数据框,将Excel文档转换为Excel,而不会破坏特殊字符(,, - ,',',...等)。



我可以通过在Word中通过替换来执行此操作,但是如果我能够将其在R中执行此操作,那么再次更容易。



这是一个MS Word文档示例,我的数据看起来像(分页栏)



https://dl.dropbox.com/u/61803503/TEST.doc



解决方案

一种方法:使用Edit-> Copy in Word and Edit- >粘贴到Excel。如果你这样做,应该保留一个简单的表格结构,保存Unicode字符。对于诸如Wingdings这样的非Unicode的东西,不太确定。没有尝试VBA,也可以。


I have transcripts of data in MS Word want to read into a stats program called R. The problem is these documents contain special characters (not plain text). My process for dealing with them has been to sub them out in MS Word/save as a txt document/read into MS Excel (makes a column for people and dialogue using the import wizard)/Convert to .csv/read into R. This process works but is time consuming. I found out how to read the text with special characters right into R (R generally wants plain text) but this requires the document be in an excel document. This is desirable because if I can read the special characters into R it's rather simple to sub out all the special characters at once. The problem arises because I can't get the MS Word document into Excel directly. I have to save it as a text file first (which I don't mind doing) and then read it in. This turns the special characters into boxes and question marks. I need to get the MS Word doc into Excel as a data frame with 2 columns (person, dialogue) without destroying the special characters (", ", —, ’, ‘, …, etc.).

I can do this by subbing out in Word with replace but again if I could get it to Excel doing this in R would be much easier.

Here is a sample MS Word doc of what my data looks like (tab separated columns)

https://dl.dropbox.com/u/61803503/TEST.doc

Excel and Word versions 2010 on a Win 7 machine.

解决方案

One way: use Edit->Copy in Word and Edit->Paste in Excel. A simple tabular structure should be preserved if you do that, with preservation of Unicode characters. Not so sure about non-Unicode stuff such as Wingdings. Haven't tried VBA-ing that, either.

这篇关于将数据从MS Word移动到MS Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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