将文本文件转换为excel? [英] convert text file to excel ?

查看:80
本文介绍了将文本文件转换为excel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何做到这一点,将测试文件转换为Excel?

假设我的文本文件包含以下字段:

数字名称地址电话

11002 Test1 TestAddress1 111-2222


假设数字字段长10个字符,有空格和

名称字段是15个字符很久,还有一个空格,地址可以是25元/ b $ b字符长,有空格和手机是10个字符长


我想把数据放在Excel中如下:

ABCD

1 11002 Test1 TestAddress1 111-2222

所以我需要读取一个文本文件,将内容放入一个excel文件和

保存为.xls

这可以作为服务完成吗?...或者它必须是.br中的.exe / >
vb 2008?谢谢

解决方案

如果你不需要为Excel项目指定格式,你可以保存

文件以CSV格式。这将导入Excel作为

字段的简单列表。名称和地址项需要用引号括起来,因为

它们可以包含逗号。或者,使用TAB而不是逗号并在导入期间接受

Excel默认值。
http://www.cknow.com/ckinfo/c/CSV-Co...atedValue.html

< pa ***** @ gmail.com写信息

新闻:f5 ******************** ************** @ a26g2000 prf.googlegroups.com ...


我该怎么做,转换测试文件excel?

假设我的文本文件包含以下字段:

NUMBER NAME ADDRESS PHONE

11002 Test1 TestAddress1 111-2222

让我们说数字字段长10个字符,有空格和

名字字段长15个字符,有空格,地址可以是25

字符长,有空格,电话长10个字符


我想把数据放在Excel中如下:

ABCD

1 11002 Test1 TestAddress1 111-2222


所以我需要读取一个文本文件,将内容放入一个excel文件和

保存为.xls

这可以作为服务完成吗?...或者它必须是.br中的.exe / >
vb 2008?谢谢


但它不是TAB分隔的。它的10个字符,一个空格,10个等等。


我不能在字段周围加上引号,因为这是我获取文件的方式,

没有引号。这个

文件的出现方式永远不会出现昏迷。


11月17日,6:06 * pm,詹姆斯哈恩" < jh ... @ yahoo.comwrote:


如果您不需要为Excel项目指定格式,您可以保存

CSV格式的文件。 *这将作为

字段的简单列表导入Excel。 *名称和地址项目需要用引号括起来,因为

它们可能包含逗号。 *或者,使用TAB而不是逗号并在导入期间接受

Excel默认值。 http://www.cknow.com/ckinfo/c/CSV-Co...atedValue.html


< pake ... @ gmail.com写信息


新闻:f5 ********************* ************* @ a26g2000 prf.googlegroups.com ...


我该怎么做,将测试文件转换为excel?

假设我的文本文件包含以下字段:

NUMBER * * * NAME * * * * * * ADDRESS * * * * * * * * PHONE

11002 * * * * * Test1 * * * * * * * TestAddress1 * * * * * 111-2222


让我们说数字字段是10个字符长,有一个空格和

名字字段长15个字符,有一个空格,地址可以是25

个字符长,有空格,电话长10个字符


我想把数据放在Excel中如下:

* * * * * A * * * * * * B * * * * * * C * * * * * * * * D

1 * * 11002 * * * Test1 * * * TestAddress1 * 111-2222


所以我需要阅读一个文本文件,将内容放入一个excel文件中

保存为.xls

这可以这样做服务?...或者它必须是一个.exe
vb 2008? *谢谢


我认为James Hahn在暗示,如果他不是我,那你就是

可以编写一个简单的文本操作程序,在值之间放置一个逗号或制表符

字符。这样的文件可以通过Excel读取。

< pa ***** @ gmail.com写在消息中

news:f4 ******** ************************** @ 1g2000pr d.googlegroups.com ...

但它不是TAB分隔的。它的10个字符,一个空格,10个等等。


我不能在字段周围加上引号,因为这是我获取文件的方式,

没有引号。这个

文件的出现方式永远不会出现昏迷。


11月17日下午6:06,James Hahn ; < jh ... @ yahoo.comwrote:


如果你不需要为Excel项目指定格式,你可以

保存

CSV格式的文件。这将导入Excel作为

字段的简单列表。名称和地址项需要用引号括起来,因为

它们可以包含逗号。或者,使用TAB代替逗号并在

import期间接受

Excel默认值。 http://www.cknow.com/ckinfo/c/CSV-Co...atedValue.html

< pake ... @ gmail.com写信息


新闻:f5 ************** ******************** @ a26g2000 prf.googlegroups.com ...


我该怎么办这个,将测试文件转换为excel?

假设我的文本文件包含以下字段:

数字名称地址电话

11002 Test1 TestAddress1 111-2222


假设数字字段长10个字符,有空格且

名称字段为15字符长,有空格,地址可以是25

字符长,有空格和电话长10个字符


我想要将数据放入Excel中,如下所示:

ABCD

1 11002 Test1 TestAddress1 111-2222


所以我需要阅读一个文本文件,将内容放入一个excel文件中

保存为.xls

这可以作为服务完成?...或者它必须是一个.exe在
vb 2008?谢谢



How would i do this, convert a test file to excel?
Lets say my text file has fields like this:
NUMBER NAME ADDRESS PHONE
11002 Test1 TestAddress1 111-2222

lets say the number field is 10 characters long, there is a space and
Name field is 15 characters long, there is a space, address can be 25
characters long, there is a space and phone is 10 characters long

I want to put the Data in Excel as follows:
A B C D
1 11002 Test1 TestAddress1 111-2222
So I need to read a text file, put the contents into an excel file and
save it as .xls
And can this be done as a service?...or does it have to be an .exe in
vb 2008? thanks

解决方案

If you don''t need to specify formatting for the Excel items, you could save
the file in CSV format. That will import into Excel as a simple list of
fields. The name and address items will need to be wrapped in quotes, as
they could include commas. Or, use TAB instead of comma and accept the
Excel default during import..
http://www.cknow.com/ckinfo/c/CSV-Co...atedValue.html

<pa*****@gmail.comwrote in message
news:f5**********************************@a26g2000 prf.googlegroups.com...

How would i do this, convert a test file to excel?
Lets say my text file has fields like this:
NUMBER NAME ADDRESS PHONE
11002 Test1 TestAddress1 111-2222

lets say the number field is 10 characters long, there is a space and
Name field is 15 characters long, there is a space, address can be 25
characters long, there is a space and phone is 10 characters long

I want to put the Data in Excel as follows:
A B C D
1 11002 Test1 TestAddress1 111-2222
So I need to read a text file, put the contents into an excel file and
save it as .xls
And can this be done as a service?...or does it have to be an .exe in
vb 2008? thanks


Its not TAB delimited though. Its 10 characters, a space, 10more, etc.

I cant put quotes around a field because this is the way I get a file,
no quotes. And there will never be a coma in that field the way this
file comes out.

On Nov 17, 6:06*pm, "James Hahn" <jh...@yahoo.comwrote:

If you don''t need to specify formatting for the Excel items, you could save
the file in CSV format. *That will import into Excel as a simple list of
fields. *The name and address items will need to be wrapped in quotes, as
they could include commas. *Or, use TAB instead of comma and accept the
Excel default during import..http://www.cknow.com/ckinfo/c/CSV-Co...atedValue.html

<pake...@gmail.comwrote in message

news:f5**********************************@a26g2000 prf.googlegroups.com...

How would i do this, convert a test file to excel?
Lets say my text file has fields like this:
NUMBER * * *NAME * * * * * * ADDRESS * * * * * * * *PHONE
11002 * * * * * Test1 * * * * * * * TestAddress1 * * * * * 111-2222

lets say the number field is 10 characters long, there is a space and
Name field is 15 characters long, there is a space, address can be 25
characters long, there is a space and phone is 10 characters long

I want to put the Data in Excel as follows:
* * * * *A * * * * * * B * * * * * *C* * * * * * * * D
1 * * 11002 * * * Test1 * * *TestAddress1 *111-2222

So I need to read a text file, put the contents into an excel file and
save it as .xls
And can this be done as a service?...or does it have to be an .exe in
vb 2008? *thanks


I think that James Hahn was suggesting, and if he wasn''t I am, that you
could write a simple text manipulation program which places a comma or tab
character between the values. Such a file can be read by Excel.
<pa*****@gmail.comwrote in message
news:f4**********************************@1g2000pr d.googlegroups.com...
Its not TAB delimited though. Its 10 characters, a space, 10more, etc.

I cant put quotes around a field because this is the way I get a file,
no quotes. And there will never be a coma in that field the way this
file comes out.

On Nov 17, 6:06 pm, "James Hahn" <jh...@yahoo.comwrote:

If you don''t need to specify formatting for the Excel items, you could
save
the file in CSV format. That will import into Excel as a simple list of
fields. The name and address items will need to be wrapped in quotes, as
they could include commas. Or, use TAB instead of comma and accept the
Excel default during
import..http://www.cknow.com/ckinfo/c/CSV-Co...atedValue.html

<pake...@gmail.comwrote in message

news:f5**********************************@a26g2000 prf.googlegroups.com...

How would i do this, convert a test file to excel?
Lets say my text file has fields like this:
NUMBER NAME ADDRESS PHONE
11002 Test1 TestAddress1 111-2222

lets say the number field is 10 characters long, there is a space and
Name field is 15 characters long, there is a space, address can be 25
characters long, there is a space and phone is 10 characters long

I want to put the Data in Excel as follows:
A B C D
1 11002 Test1 TestAddress1 111-2222

So I need to read a text file, put the contents into an excel file and
save it as .xls
And can this be done as a service?...or does it have to be an .exe in
vb 2008? thanks



这篇关于将文本文件转换为excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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