diff --git a/README.md b/README.md index 2db3431..e2f78a1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 3. **DataInspector**,数据文件查看、编辑、转换工具 4. **QuantBox行情数据存储方案**,文件格式设计思路 5. **Data**,行情示例文件 -6. **SelfDecode**,.pd0/.7z子解压程序.解压当前目录以及子目录下的数据,到csv文件.默认解压到当前目录的SelfDecodeData下面 +6. **SelfDecode**,.pd0/.7z自解压程序(没有拓展名的文件,按.pd0文件处理).解压当前目录以及子目录下的数据,到csv文件.默认解压到当前目录的SelfDecodeData下面 ## 在自己的项目中使用 引用**QuantBox\.Data\.Serializer**库即可,参考**DataInspector**中的使用方法,再转换成自己系统中的数据格式
diff --git a/SelfDecode/Program.cs b/SelfDecode/Program.cs index 9730600..0259256 100644 --- a/SelfDecode/Program.cs +++ b/SelfDecode/Program.cs @@ -31,6 +31,7 @@ private static void ReadDirectorys(string pathChosen) { string filename = Path.GetFileName(file); string[] fe = filename.Split('.'); + // 没有拓展名的,直接尝试解压 if(fe.Length == 1) { Console.WriteLine("File: OK, {0}", file); @@ -94,9 +95,21 @@ private static void SaveCSV(List listTickView, string fullPathFile) } } sw.WriteLine(data); + string aPx,aSz,bPx,bSz; // 写数据 foreach(var tickView in listTickView) { + if (tickView.DepthList == null) + { + aPx = ""; + aSz = ""; + bPx = ""; + bSz = ""; + } + else + { + aPx = String.Format{"{0}", } + } data = String.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11}", tickView.TradingDay, tickView.ActionDay, @@ -185,7 +198,7 @@ private static Tuple ReadToStream(string pathChosen) listFileNames.Add(extractor.ArchiveFileNames[i]); } - string fileName = "default"; + string fileName = listFileNames.Count == 0? "default" : listFileNames[0]; MemoryStream stream = new MemoryStream(); try diff --git a/SelfDecode/SelfDecode.csproj b/SelfDecode/SelfDecode.csproj index c461328..2bf9366 100644 --- a/SelfDecode/SelfDecode.csproj +++ b/SelfDecode/SelfDecode.csproj @@ -17,7 +17,7 @@ true full false - ..\bin\Debug\ + ..\Data\ DEBUG;TRACE prompt 4 diff --git a/Test/Test.csproj b/Test/Test.csproj index be78cc7..ba518c6 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -21,7 +21,7 @@ true full false - bin\Debug\ + ..\bin\Debug\ DEBUG;TRACE prompt 4 @@ -29,7 +29,7 @@ pdbonly true - bin\Release\ + ..\bin\Release\ TRACE prompt 4