zoukankan      html  css  js  c++  java
  • 基于System.Text导入

    public void GetTxT()
    {
    string ACellNameChecked = "";
    string InSysInterAnalyReportWordSavePath;
    ACellNameChecked = InvalidCellNameCharsRemoveForFilePath(AnalysisCellNamecomboBox.Text);
    if (!Directory.Exists(InterferenceAnalysisResultSavePath + "\各小区优化方案报告(TXT)"))
    Directory.CreateDirectory(InterferenceAnalysisResultSavePath + "\各小区优化方案报告(TXT)");
    InSysInterAnalyReportWordSavePath = InterferenceAnalysisResultSavePath + "\各小区优化方案报告(TXT)" + "\" + ACellNameChecked + "网内干扰优化方案.txt";

    StreamReader ParamsTxT = new StreamReader(InSysInterAnalyReportWordSavePath, Encoding.UTF8);
    string SR = "";
    while ((SR = ParamsTxT.ReadLine()) != null)
    {
    List<string> ParamsList = SR.Split(';').ToList();

    for (int i = 0; i < ParamsList.Count; i++)
    {

    if (ParamsList[i].Contains("受扰小区:") ||
    ParamsList[i].Contains("干扰源邻区1:") ||
    ParamsList[i].Contains("干扰源邻区2:") ||
    ParamsList[i].Contains("干扰源邻区3:"))
    {
    Dictionary<string, List<string>> Params = new Dictionary<string, List<string>>();
    for (int j = 0; j < ParamsList.Count/3; j++)
    {
    List<string> list = new List<string>();
    list.Add(ParamsList[1 + j * 3]);
    list.Add(ParamsList[2 + j * 3]);
    list.Add(ParamsList[3 + j * 3]);
    Params.Add(ParamsList[2 + j * 3].Split(':')[0], list);
    }
    DictionaryParamsTxT.Add(ParamsList[i].Split(':')[1], Params);
    }
    }
    }

    ParamsTxT.Close();
    }

  • 相关阅读:
    javascript教程系列-10.DOM(下)
    javascript教程系列-9.DOM(上)
    javascript教程系列-8.BOM
    javascript教程系列-7.Date对象
    javascript教程系列-6.String类型
    javascript教程系列-5.数组
    Python字符串、元组、列表、字典互相转换的方法
    python 中函数
    python中的字符串 列表 字典
    python 基础 知识
  • 原文地址:https://www.cnblogs.com/SiSui/p/9546992.html
Copyright © 2011-2022 走看看