wsm 发表于 2009-2-25 12:37:22

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

as the title.
txt file is like:
aaa 1 2 3 4
bbb5 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 编辑 ]

jiangtao9999 发表于 2009-2-25 13:20:05

execel貌似可以自定义分割符

wsm 发表于 2009-2-26 16:51:38

really???

jiangtao9999 发表于 2009-2-26 20:46:49

你真的不知道?

wsm 发表于 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......

jiangtao9999 发表于 2009-2-27 13:28:45

你没注意过 csv 文件的内容么……
就是一个 txt ,用 , 分割的各个段落。
你只要把相应的字符转换为 , 就行了。
Office 软件都支持直接导入 txt 文件的。只不过你只需要把默认的 , 改为你作为分隔的字符而已。
我很不明白你怎么导入的乱七八糟。

wsm 发表于 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.

jiangtao9999 发表于 2009-3-6 16:09:06

excel 和你用脚本替换后再导入的结果没区别。
印象里 excel 可以选择是连续空格为一个分隔符,还是一个空格就是一个分隔符。

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

wsm 发表于 2009-3-13 20:38:15

说起来蛮复杂的
cadence里面默认输出的数据是这样的
GBW   45Mhz
xxx      107dB
输到excel里面怎么都成不了比较好看的表格
不过现在直接在cadence里面做处理了,输出来也不用什么表格了,直接看最好最坏值,然后数据格式变成45e+6这样子

jiangtao9999 发表于 2009-3-13 21:19:56

:shock:
页: [1]
查看完整版本: who have a script (perl python) transfer a txt file to a csv file: