QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2256|回复: 9

who have a script (perl python) transfer a txt file to a csv file:

[复制链接]
发表于 2009-2-25 12:37:22 | 显示全部楼层 |阅读模式
as the title.
txt file is like:
aaa 1 2 3 4
bbb  5 6 7 8
separated by blank.
I want to create a table to used in excel, i think the simplest way is CSV file.

[ 本帖最后由 wsm 于 2009-2-25 12:39 编辑 ]
发表于 2009-2-25 13:20:05 | 显示全部楼层
execel貌似可以自定义分割符
回复

使用道具 举报

 楼主| 发表于 2009-2-26 16:51:38 | 显示全部楼层
really???
回复

使用道具 举报

发表于 2009-2-26 20:46:49 | 显示全部楼层
你真的不知道?
回复

使用道具 举报

 楼主| 发表于 2009-2-27 12:09:57 | 显示全部楼层
but i am under linux, so there is no excel.
but i try openoffice, it somehow works at a txt file but the format looks really bad!
before, we have a tcl script to transfer a txt to a csv file, but i lost it......
回复

使用道具 举报

发表于 2009-2-27 13:28:45 | 显示全部楼层
你没注意过 csv 文件的内容么……
就是一个 txt ,用 , 分割的各个段落。
你只要把相应的字符转换为 , 就行了。
Office 软件都支持直接导入 txt 文件的。只不过你只需要把默认的 , 改为你作为分隔的字符而已。
我很不明白你怎么导入的乱七八糟。
回复

使用道具 举报

 楼主| 发表于 2009-3-6 14:49:18 | 显示全部楼层
there are so many sapce and tabs in the txt file, so when it goes into the excel, there are many columns.
回复

使用道具 举报

发表于 2009-3-6 16:09:06 | 显示全部楼层
excel 和你用脚本替换后再导入的结果没区别。
印象里 excel 可以选择是连续空格为一个分隔符,还是一个空格就是一个分隔符。

不过这个又一个问题是,你导入的数据里面含也有空格怎么解决。我想你现在遇到的困难是这个吧?
回复

使用道具 举报

 楼主| 发表于 2009-3-13 20:38:15 | 显示全部楼层
说起来蛮复杂的
cadence里面默认输出的数据是这样的
GBW   45Mhz
xxx      107dB
输到excel里面怎么都成不了比较好看的表格
不过现在直接在cadence里面做处理了,输出来也不用什么表格了,直接看最好最坏值,然后数据格式变成45e+6这样子
回复

使用道具 举报

发表于 2009-3-13 21:19:56 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-19 20:43 , Processed in 0.056702 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表