『最佳拍檔』智能決策系統

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3845|回复: 10

請教Matthew 大師/大大師兄

[复制链接]
发表于 2010-6-9 17:20:10 | 显示全部楼层 |阅读模式
本帖最后由 alice 于 2010-6-9 18:13 编辑

點將個.txt file convert做excel file?

(.txt file)  (date and time have not separated)

20100602 094500; 19577; 19620; 19558; 19609; 895
20100602 094601; 19606; 19686; 19606; 19650; 825
20100602 094700; 19647; 19665; 19640; 19654; 617

(excel file)  (date and time have separated)
2/6/2010
09:45:00
19577196201955819609895
2/6/2010
09:46:01
19606196861960619650825
2/6/2010
09:47:00
19647196651964019654617
发表于 2010-6-9 18:31:04 | 显示全部楼层
你可以 Ctrl + H 將 "; " 先全部用 ";"  替代,
再將 " " 以  ";" 替代,  便可以得到一個 以 ";" 做分格的 txt,
用 excel 讀入這個 text 檔案,
選分格符號用 ";" 便可以讀入並自動分欄 !
 楼主| 发表于 2010-6-9 22:04:30 | 显示全部楼层
本帖最后由 alice 于 2010-6-9 22:44 编辑

2# admin
2/6/20109450019577196201955819609895
2/6/20109460119606196861960619650825
2/6/20109470019647196651964019654617

DATE都OK,但TIME果個COLUMN點整?
試過轉時間格式做hh:mm:ss
但出來全是00:00:00

又或點先可以匯入MetaStock?用DL果個convert失敗了!
发表于 2010-6-9 23:35:33 | 显示全部楼层
自己用 Excel 技巧做些少手腳, 將佢轉換成時間格式先,
再取代一行便可以 ~


=MID(A1,1,2) & ":" & MID(A1,3,2) & ":" & MID(A1,5,2)



日期要用 YYYYMMDD 格式, 否則不會成功 ~



excel_mid.png
 楼主| 发表于 2010-6-9 23:46:26 | 显示全部楼层
本帖最后由 alice 于 2010-6-9 23:47 编辑

2/6/20109450019577196201955819609895
2/6/20109460119606196861960619650825
2/6/20109470019647196651964019654617

"094500"第1個"0"唔見了,點整返出現?
发表于 2010-6-10 01:54:15 | 显示全部楼层
用 EXCEL 讀入時, 將該欄選 "文字"
 楼主| 发表于 2010-6-10 10:11:12 | 显示全部楼层
6# admin
OK!THX Matthew 大師!!!
 楼主| 发表于 2010-6-11 12:18:20 | 显示全部楼层
Matthew大師,
我想將原本果個.TXT file直接匯入metastock,可否教多個方法,thx!
发表于 2010-6-11 13:54:00 | 显示全部楼层
你可以先睇睇個 Help 有例子可跟著試試~

基本上使用 The Downloader -> Convert 功能
而你要轉換的文字檔案內格式, 一定要跟說明的格式相同才可以順利轉換的 !!

convert.gif

ASCII Source File Layout
In order for an ASCII source file to convert properly, the file must be arranged correctly. This section explains the proper alignment.
The data in the ASCII file should be arranged as shown below.

<ticker>, <per>, <date>, <time>, <open>, <high>, <low>, <close>, <vol>, <o/i>


An ASCII source file can also contain a <name> field. This is helpful if your destination file is in the MetaStock format and you want the name of MetaStock file to be different than the ticker symbol . If you choose to include a <name> field in your ASCII file, you must define a header line, otherwise the conversion will fail. The following header line is an example.


<ticker>, <name>, <per>, <date>, <close>, <vol>


<ticker> The ticker symbol of the security. The ticker symbol is used to determine which MetaStock data file to post the data to. The ticker symbol (if you choose to specify it in the ASCII file) must be included on every line of data.

If the ticker symbol in the ASCII file does not match a ticker symbol in the MetaStock data files, you will be asked if you want to create a new MetaStock data file.
If the ticker symbol in the ASCII file includes a space, a comma-delimited header line must be created at the top of the ASCII file (see ASCII Source File Layout on how to create a header line). The header line allows the file to be processed using only commas as delimiter characters.
The ticker field can be omitted, but only if the <per> field is also omitted. If the ticker symbol is omitted, you are prompted to supply the ticker symbol (see Ticker Symbol Dialog).

<per> The periodicity of the data (e.g., Intraday, Daily, Weekly, Monthly, or Yearly).

If this field is omitted, the periodicity selected in the Conversion Options dialog is used (see Conversion Options Dialog).

<date> The date of the data contained on the line of the ASCII file. Each line of the ASCII file must have a date. The date can be in either the yyyymmdd or mm/dd/yyyy formats (e.g., 19891222 or 12/22/1989), and can use either 2-digit or 4-digit years.

When using 2-digit years in Windows 95 or Windows NT 4.0, TheownLoader will assume any number preceding "30" should begin with "20", years "30" and higher will begin with "19." When using 2-digit years in Windows 98 or Windows 2000, TheownLoader will use the Regional Settings found in your Windows Control Panel.
The dates must be in ascending order (i.e., most recent date is listed on the last line).
If the dates in the ASCII file precede the dates in the existing MetaStock file (i.e., the file you are appending to), the data will be ignored.

<time>. The time of the data contained on the line of the ASCII file. This field should only be used if the ASCII file contains intraday price data (i.e., the periodicity is intraday). The time should be entered using a 24 hour clock (e.g., 3:30 PM = 15:30).


<open>The opening price of the security. The open field can be omitted if the open interest (<o/i>) field is also omitted.


<high> The high price for this date.


<low> The low price for this date.


<close> The closing (last) price for this date.


<vol> The volume for this date.


<o/i> The open interest for this date. The open interest field can be omitted if the open (<open>) field is also omitted.


EXAMPLE INPUT:


IBM,D,7/29/86,121,122.375,120.500,121.75,624589,0
IBM,D,7/30/86,123.375,123.125,122.5,122.75,431234,0
MOB,D,7/29/86,28.25,29.5,27.125,28,12627,0
MOB,D,7/30/86,30,30.625,29.875,30.375,7588,0


Because the <open> and <o/i> fields are optional, this data also could be arranged as shown below.


IBM,D,7/29/86,122.375,120.500,121.75,624589
IBM,D,7/30/86,123.125,122.5,122.75,431234
MOB,D,7/29/86,29.5,27.125,28,12627
MOB,D,7/30/86,30.625,29.875,30.375,7588


If all the data in the ASCII file is for one security only, then the <ticker> and <per> fields can be omitted. The data can be arranged as shown below. You will be prompted for the ticker symbol.


7/27/96,41.375,40.5,40.75,524589      
7/38/96,42.5,40.5,41.75,345679
7/29/96,42.375,41.125,41.75,678967
7/30/96,43.625,42.500,43.125,564479


If all the data in the ASCII file is for one security only, then the <ticker> ,<per>,<high>,<low>, and
<vol> fields can be omitted. The data can be arranged as shown below. You will be prompted for the ticker symbol.


7/27/96,40.75      
7/38/96,41.75
7/29/96,41.75
7/30/96,43.125


In the resulting MetaStock files, the other price fields will be automatically filled with the close values. The volume fields will be filled with zeros.


A header line can be placed at the top of the ASCII file to specify the arrangement of the data. This allows you to arrange the data in any order you wish. The line below shows volume appearing before the price fields.


<date>,<vol>,<high>,<low>,<close>
7/29/86,624589,122.375,120.500,121.75      
7/30/86,431234,123.125,122.5,122.75
7/29/86,12627,29.5,27.125,28
7/30/86,7588,30.625,29.875,30.375





e.g.
{text file}

test,I,20100602,09:45:00,19577,19620,19558,19609,895
test,I,20100602,09:46:01,19606,19686,19606,19650,825
test,I,20100602,09:47:00,19647,19665,19640,19654,617



convert4.gif


convert3.gif


convert5.gif

 楼主| 发表于 2010-6-11 17:04:39 | 显示全部楼层
我個text file點先轉到你個text file例子?你個file的時間可以轉成xx:xx:xx
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|『最佳拍檔』智能決策系統

GMT+8, 2024-5-9 17:17 , Processed in 0.082831 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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