示例#1
0
        private void button5_Click(object sender, EventArgs e)
        {
            //読込実行処理
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("読込処理開始");
            //TXTファイルが選択されていない場合
            if (fileTXT == "")
            {
                if (dialogTXT() != 0)
                {
                    return;
                }
            }

            //SKTファイルが選択されていない場合
            DataTable dt = new DataTable();

            if (fileSKT == "")
            {
                //DB接続
                ClassMSA msa = new ClassMSA();
                if (msa.checkDB(fileMdb, logPath, dt) != 0)
                {
                    //MSAccessデータに問題があるとき、SKTタグを参照
                    cl.logWarning("MSAccessデータに問題があり、SKTタグを参照", null);
                    MessageBox.Show("MSAccessデータに問題があります。\nSKTファイルを選択してください。", "Warning", MessageBoxButtons.OK);
                    return;
                }
            }
            else
            {
                //SKTファイルを開いて、タグを格納する
                setDT(fileSKT, dt);
            }

            //写研TXTファイルを開いて、整理されたタグと写研データを表示する
            //this.Enabled = false;
            DGVForm1 dgvf1 = new DGVForm1(logPath);

            dgvf1.setFile(fileSKT, fileTXT, dt);
            dgvf1.ShowDialog();
            dgvf1.Dispose();
            dt.Clear();
            cl.logInfo("読込処理終了");
            //cl.dispose();
            GC.Collect();
        }
示例#2
0
        private int readTXTFile(string txt, List <string> skt)
        {
            //写研データを読込んで、タグを区別する
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("写研データを(byte)読み込んで、タグを収集します。");
            FileStream fs = null;

            byte[] bs  = new byte[0x1000];
            bool   flg = false;
            string tmp = "";

            try
            {
                fs = new FileStream(txt, FileMode.Open, FileAccess.Read);
                while (fs.Read(bs, 0, bs.Length) > 0)
                {
                    foreach (byte b in bs)
                    {
                        if (b >= F0)
                        {
                            flg = true;
                            tmp = String.Format("{0:X}", b);
                        }
                        else if (flg)
                        {
                            flg  = false;
                            tmp += String.Format("{0:X}", b);
                            //同じ値が入らないようソート
                            if (!skt.Contains(tmp))
                            {
                                skt.Add(tmp);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                cl.logError(txt, ex);
                return(1);
            }
            finally
            {
                if (fs != null)
                {
                    fs.Close();
                }
            }
            skt.Remove("");
            return(0);
        }
示例#3
0
        private int writeTXTFile(string txt)
        {
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("タグファイルの書き込み開始:" + txt);

            StreamWriter  sw  = null;
            StringBuilder tmp = new StringBuilder();

            try
            {
                sw = new StreamWriter(txt, false, Encoding.GetEncoding("shift_jis"));
                for (int i = 0; i < dataGridView1.RowCount; i++)
                {
                    for (int j = 0; j < dataGridView1.ColumnCount; j++)
                    {
                        if (dataGridView1.Rows[i].Cells[j].Value != null)
                        {
                            tmp.Append(dataGridView1.Rows[i].Cells[j].Value.ToString());
                        }
                        tmp.Append(';');
                    }
                    sw.WriteLine(tmp.ToString().Substring(0, tmp.ToString().Length - 1));
                    tmp.Clear();
                }
            }
            catch (Exception ex)
            {
                cl.logError(txt + "の書き込み失敗:", ex);
                return(1);
            }
            finally
            {
                if (sw != null)
                {
                    sw.Close();
                    sw.Dispose();
                    //cl.dispose();
                }
            }

            return(0);
        }
示例#4
0
        private void setDT(string str, DataTable dt)
        {
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("SKTファイルの読み込み開始");
            try
            {
                Encoding enc   = Encoding.GetEncoding("shift_jis");
                string[] lines = File.ReadAllLines(str, enc);

                dt.Columns.Add("pattern", typeof(int));
                dt.Columns.Add("SK", typeof(string));
                dt.Columns.Add("MCS", typeof(string));
                dt.Columns.Add("detail", typeof(string));

                for (int i = 0; i < lines.Length; i++)
                {
                    if (lines[i] != "")
                    {
                        string[] parts = lines[i].Split(';');
                        if (parts.Length == 4)
                        {
                            dt.Rows.Add(parts[0], parts[1], parts[2], parts[3]);
                        }
                        else
                        {
                            cl.logDebug(str + ":" + i + "行目フォーマットエラー:" + lines[i]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                cl.logError(str, ex);
                //cl.dispose();
            }
        }
示例#5
0
        private void openIni()
        {
            const string DATAFILENAME = "datafilename";
            const string LOGPATH      = "logpath";
            //ini設定を行う
            string appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string iniFile = appPath + "\\setup.ini";

            //setup.iniファイルの存在確認
            if (File.Exists(iniFile))
            {
                //ファイルを開き、設定値を行う
                List <string> lines = new List <string>();
                if (openFile(lines, iniFile) == 0)
                {
                    Dictionary <string, string> dict = new Dictionary <string, string>();
                    foreach (string line in lines)
                    {
                        if (line != "")
                        {
                            string[] tmp = line.Split('=');
                            if (tmp.Length == 2)
                            {
                                dict[tmp[0].Trim()] = tmp[1].Trim();
                            }
                        }
                    }
                    fileMdb = dict[DATAFILENAME];
                    logPath = dict[LOGPATH];
                    ClassLog cl1 = new ClassLog(logPath);
                    cl1.logInfo("Main開始");
                    //cl1.dispose();

                    lines.Clear();
                    return;
                }
            }
            //デフォルト値を設定し、Setup.iniファイルを作成する
            const string DT  = "skttable.mdb";
            const string LP  = "C:\\log";
            Encoding     enc = Encoding.GetEncoding("shift_jis");
            StreamWriter sw  = null;
            ClassLog     cl  = new ClassLog(LP);

            logPath = LP;
            try
            {
                cl.logInfo("Main開始/setup.ini作成");
                sw = new StreamWriter(iniFile, false, enc);
                sw.WriteLine(LOGPATH + '=' + LP);
                sw.WriteLine(DATAFILENAME + '=' + DT);
            }
            catch (Exception ex)
            {
                cl.logError(iniFile, ex);
            }
            finally
            {
                if (sw != null)
                {
                    sw.Close();
                }
                //cl.dispose();
            }
        }
示例#6
0
        private void patMath(List <string> lines)
        {
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("パターン3、数式変換開始");

            //パターン3のタグを
            List <string> sk = new List <string>();
            List <string> ms = new List <string>();

            getPat("3", sk, ms);

            //最初の要素StartとEndとする
            char          start;
            List <char>   end    = new List <char>();
            List <string> msMath = new List <string>();

            string[] sp = sk[0].Split(SCHAR);
            start = convToInt32(sp[0]);
            for (int j = 1; j < sp.Length; j++)
            {
                end.Add(convToInt32(sp[j]));
            }

            sp = ms[0].Split(SCHAR);
            foreach (string str in sp)
            {
                msMath.Add(str);
            }

            //
            int           i = 0;
            int           istart;
            StringBuilder sb = new StringBuilder();
            string        tmp;

            while (i < lines.Count)
            {
                char[] ch = lines[i].ToCharArray();
                int    ii = 0;
                istart = 0;
                sb.Clear();
                while (ii < ch.Length)
                {
                    if (ch[ii] > INTCHAR)
                    {
                        if (ch[ii] == start)
                        {
                            //「E2」〇「E1」
                            tmp = "";
                            sb.Append(lines[i].Substring(istart, ii - istart));
                            if (msMath.Count > 0)
                            {
                                sb.Append(msMath[0]);
                            }
                            else
                            {
                                cl.logDebug(i + "行:<MATH>定義(msタグ)にエラー");
                            }
                            istart = ii + 1;
                            while (ii < ch.Length)
                            {
                                //end->「E1」が「送2」か判定する
                                if (ch[++ii] == end[0] || ii == ch.Length - 1)
                                {
                                    istart = ii + 1;
                                    break;
                                }
                                tmp += ch[ii];
                            }
                            //本番処理:〇
                            for (int j = 1; j < sk.Count; j++)
                            {
                                string[] ss = sk[j].Split(SCHAR);
                                switch (ss.Length)
                                {
                                case 1:
                                    tmp = subMath1(tmp, ss[0], ms[j]);
                                    break;

                                case 2:
                                    tmp = subMath2(tmp, ss[0], ss[1], ms[j]);
                                    break;

                                default:
                                    cl.logDebug("パターン3のSKタグの宣言が合ってない");
                                    break;
                                }
                            }
                            if (tmp == "")
                            {
                                cl.logDebug("パターン3のSKタグの宣言が合ってない");
                            }
                            else
                            {
                                int ist = 0, ind;
                                //string lol = "</MX<MX>><MF>";
                                //while (true)
                                //{
                                //    ind = tmp.Substring(ist).IndexOf(lol);
                                //    if (ind >= 0)
                                //    {
                                //        sb.Append(tmp.Substring(ist, ind - ist));
                                //        ist = ind + lol.Length;
                                //    }
                                //    else break;
                                //}
                                sb.Append(tmp.Substring(ist));
                            }

                            //end->「E1」が「送2」か判定したところに</MATH>追加
                            if (msMath.Count > 1)
                            {
                                sb.Append(msMath[1]);
                            }
                            else
                            {
                                cl.logDebug(i + "行:</MATH>定義(msタグ)にエラー");
                            }
                        }
                    }
                    ii++;
                }
                sb.Append(lines[i].Substring(istart));
                lines[i++] = sb.ToString();
            }
            cl.logInfo("パターン3、数式変換終了");
            end.Clear();
            sk.Clear();
            ms.Clear();
            msMath.Clear();
            sb.Clear();
        }
示例#7
0
        public int checkDB(string str, string log, DataTable dt)
        {
            ClassLog cl = new ClassLog(log);

            cl.logInfo("MSAccess接続します。");
            logPath = log;
            mdb     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + str;
            //mdbファイルの存在確認
            if (!File.Exists(mdb))
            {
                //mdbファイルの作成
                cl.logInfo("mdbファイルが存在しません。作成します。");
                try
                {
                    File.Copy(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + tmpDB, mdb);
                }
                catch (Exception ex)
                {
                    cl.logError("tmpmdbファイル移動エラー", ex);
                }
                //cl.dispose();
                return(1);
            }
            else
            {
                //mdbファイルの中身、テーブルが格納されているか確認する
                cl.logInfo("テーブルの確認、開始");

                OleDbConnection con = new OleDbConnection();
                OleDbCommand    cmd = null;
                OleDbDataReader odr = null;
                con.ConnectionString = strOLEDB + strDS + mdb;
                try
                {
                    con.Open();
                    cmd             = new OleDbCommand();
                    cmd.Connection  = con;
                    cmd.CommandText = sql1;
                    odr             = cmd.ExecuteReader();
                    if (odr != null)
                    {
                        cl.logInfo("データ読み込み開始");
                        dt.Load(odr);
                        return(0);
                    }
                }
                catch (Exception ex)
                {
                    cl.logError("テーブルが破壊されています。", ex);
                }
                finally
                {
                    if (con != null)
                    {
                        con.Close();
                        cmd.Dispose();
                        con.Dispose();
                    }
                }
                return(1);
            }
        }
示例#8
0
        private void patTai(List <string> lines)
        {
            //「体」で始めるパターンを消す作業
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("パターン1、「体」で始めるパターンを消す作業開始");

            List <string> sk  = new List <string>();
            List <string> ms  = new List <string>();
            List <char>   pat = new List <char>();

            getPat("1", sk, ms);

            foreach (string tmp in sk)
            {
                string[] sp = tmp.Split(SCHAR);
                if (sp.Length > 0)
                {
                    foreach (string s in sp)
                    {
                        pat.Add(convToInt32(s));
                    }
                }
            }
            sk.Clear();
            ms.Clear();
            if (pat.Count <= 0)
            {
                //タグ取得失敗
                cl.logDebug("タグ取得失敗");
                return;
            }
            if (pat.Count == 1)
            {
                //パターンがただしくない
                cl.logDebug("パターンがただしくない");
                return;
            }
            //最初の要素Start=「体」とする
            int           ii = 0;
            int           start = 0, end;
            bool          flg = false;
            StringBuilder sb  = new StringBuilder();

            for (int i = 0; i < lines.Count; i++)
            {
                ii = 0; start = 0;
                sb.Clear();
                char[] ch = lines[i].ToCharArray();
                while (ii < lines[i].Length)
                {
                    if (ch[ii] >= INTCHAR)
                    {
                        //「体」で始めるパターンかを判定
                        if (ch[ii] == pat[0])
                        {
                            //「体」〇「-」〇でパターン化
                            end = ii;
                            ii++;
                            while (ii < lines[i].Length)
                            {
                                flg = false;
                                for (int j = 0; j < pat.Count; j++)
                                {
                                    if (ch[ii] == pat[j])
                                    {
                                        flg = true;
                                        break;
                                    }
                                }
                                if (flg == false)
                                {
                                    break;
                                }
                                ii++;
                            }
                            //start->iiまでがパターン分になる
                            sb.Append(lines[i].Substring(start, end - start));
                            start = ii;
                        }
                    }
                    ii++;
                }
                sb.Append(lines[i].Substring(start));
                lines[i] = sb.ToString();
            }
            cl.logInfo("パターン1、「体」で始めるパターンを消す作業終了");
            sb.Clear();
            pat.Clear();
        }
示例#9
0
        private void setFile(string str)
        {
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("写研テキストファイルを開く:" + fileTXT);
            Encoding enc = Encoding.GetEncoding("shift_jis");
            //写研テキストファイルを開く
            List <string> lines = new List <string>();
            StreamReader  sr    = null;

            try
            {
                sr = new StreamReader(fileTXT, enc);
                while (sr.Peek() > -1)
                {
                    lines.Add(sr.ReadLine());
                }
            }
            catch (Exception ex)
            {
                cl.logError(fileTXT + "の読み込み失敗:", ex);
                return;
            }
            finally
            {
                if (sr != null)
                {
                    sr.Close();
                    sr.Dispose();
                }
            }

            //変換処理
            lines.Remove("\n");
            replaceT(lines);
            //書き込み
            cl.logInfo("書き込み開始:" + str);
            StreamWriter sw = null;

            try
            {
                sw = new StreamWriter(str, false, Encoding.GetEncoding("shift_jis"));
                foreach (string line in lines)
                {
                    sw.WriteLine(line);
                }
            }
            catch (Exception ex)
            {
                cl.logError(str + "の書き込み失敗:", ex);
            }
            finally
            {
                if (sw != null)
                {
                    sw.Close();
                    sw.Dispose();
                    //cl.dispose();
                    lines.Clear();
                }
            }
        }
示例#10
0
        private void fontSet(List <string> lines)
        {
            //「F始」〇「F終」「/」「E1」~「E3」のパターン化
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("パターン2、フォント設定開始");

            List <string> sk   = new List <string>();
            List <string> ms   = new List <string>();
            List <char>   pat  = new List <char>();
            List <string> font = new List <string>();

            getPat("2", sk, ms);

            foreach (string tmp in sk)
            {
                string[] sp = tmp.Split(SCHAR);
                if (sp.Length > 0)
                {
                    foreach (string s in sp)
                    {
                        pat.Add(convToInt32(s));
                    }
                }
            }
            sk.Clear();

            foreach (string tmp in ms)
            {
                string[] sp = tmp.Split(SCHAR);
                if (sp.Length > 0)
                {
                    foreach (string s in sp)
                    {
                        font.Add(s);
                    }
                }
            }
            ms.Clear();

            //最初の要素Start=「体」とする
            int           ii, start, end;
            bool          flg, first;
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < lines.Count; i++)
            {
                char[] ch = lines[i].ToCharArray();
                ii    = 0;
                start = 0;
                end   = 0;
                sb.Clear();
                while (ii < ch.Length)
                {
                    if (ch[ii] > INTCHAR)
                    {
                        first = true;
                        //「F始」で始めるパターンかを判定
                        while (ii < ch.Length && ch[ii] == pat[0])
                        {
                            //xx=KJ,KN,FP,FC,GR,RBなので
                            string tmp = "";
                            flg = false;
                            while (ch[++ii] != pat[1] && ii < ch.Length)
                            {
                                tmp += ch[ii].ToString();
                            }
                            foreach (string f in font)
                            {
                                if (tmp == f)
                                {
                                    flg = true;
                                    break;
                                }
                            }
                            if (flg)
                            {
                                if (first)
                                {
                                    first = false;
                                    end   = ii - 3;
                                }
                                //「F終」「/」ときてるので
Label1:
                                //どこかに出力tmp
                                if (ch[++ii] == pat[2])
                                {   //次の「/」が来るまで回す
                                    tmp = "";
                                    while (ch[++ii] != pat[2] && ii < ch.Length)
                                    {
                                        tmp += ch[ii].ToString();
                                    }
                                    //「E1」~「E3」のとき
                                    if (++ii < ch.Length && ch[ii] > INTCHAR)
                                    {
                                        flg = false;
                                        for (int j = 3; j < pat.Count; j++)
                                        {
                                            if (ch[ii] == pat[j])
                                            {
                                                flg = true;
                                                break;
                                            }
                                        }
                                        if (flg == true)
                                        {
                                            goto Label1;
                                        }
                                    }
                                }
                            }
                        }
                        if (first == false)
                        {
                            sb.Append(lines[i].Substring(start, end - start));
                            start = ii;
                        }
                    }
                    ii++;
                }
                sb.Append(lines[i].Substring(start));
                lines[i] = sb.ToString();
            }
            cl.logInfo("パターン2、フォント設定終了");
            sb.Clear();
            font.Clear();
            pat.Clear();
        }
示例#11
0
        private void colorSet(List <string> lines)
        {
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("パターン4、いろの設定開始");

            List <string> sk  = new List <string>();
            List <string> ms  = new List <string>();
            List <char>   pat = new List <char>();

            getPat("4", sk, ms);

            if (sk.Count > 1)
            {
                foreach (string tmp in sk)
                {
                    string[] sp = tmp.Split(SCHAR);
                    if (sp.Length > 0)
                    {
                        foreach (string s in sp)
                        {
                            pat.Add(convToInt32(s));
                        }
                    }
                    else
                    {
                        //色の設定情報のフォーマットが合っていない
                        cl.logDebug("色の設定情報のフォーマットが合っていない");
                        return;
                    }
                }
            }
            else
            {
                //色の設定情報が足りない
                cl.logDebug("色の設定情報が足りない");
                return;
            }
            sk.Clear();
            if (ms.Count > 1)
            {
                foreach (string tmp in ms)
                {
                    string[] sp = tmp.Split(SCHAR);
                    if (sp.Length > 0)
                    {
                        foreach (string s in sp)
                        {
                            sk.Add(s);
                        }
                    }
                    else
                    {
                        //色の設定情報のフォーマットが合っていない
                        cl.logDebug("色の設定情報のフォーマットが合っていない");
                        return;
                    }
                }
            }
            else
            {
                //色の設定情報が足りない
                cl.logDebug("色の設定情報が足りない");
                return;
            }
            ms.Clear();
            //「F始」CO「F終」「/」色の設定「/」
            int           i = 0;
            int           ii;
            int           istart = 0, iend = 0;
            string        co  = "";
            string        val = "";
            StringBuilder sb  = new StringBuilder();

            while (i < lines.Count)
            {
                char[] ch = lines[i].ToCharArray();
                sb.Clear();
                ii     = 0;
                istart = 0;
                while (ii < ch.Length)
                {
                    if (ch[ii] > INTCHAR)
                    {
                        if (ch[ii] == pat[0])
                        {
                            //「F始」
                            string tmp = "";
                            while (ii++ < ch.Length && ch[ii] != pat[1])
                            {
                                //COを格納
                                tmp += ch[ii];
                            }
                            if (tmp == sk[0])
                            {
                                //COで、次の「/」色の設定「/」
                                iend = ii - 3;
                                sb.Append(lines[i].Substring(istart, iend - istart));
                                tmp = ch[ii].ToString();

                                if (++ii < ch.Length && ch[ii] == pat[2])
                                {
                                    tmp = "";
                                    while (++ii < ch.Length)
                                    {
                                        if (ch[ii] == pat[2])
                                        {
                                            break;
                                        }
                                        tmp += ch[ii];
                                    }
                                    //色の設定
                                    if (tmp.Length != 0)
                                    {
                                        co = "";
                                        int j = 0;
                                        if (tmp.IndexOf(pat[3]) > 0)
                                        {
                                            while (tmp[j] != pat[3] && j < tmp.Length)
                                            {
                                                co += tmp[j++];
                                            }
                                            //co=black
                                            int index = tmp.Substring(j).IndexOf(co);
                                            if (index > 0)
                                            {
                                                tmp = tmp.Substring(co.Length * 2 + index);
                                                val = "";
                                                foreach (char c in tmp)
                                                {
                                                    //F942,F943,F977,F975が既定したので4から数字が始める
                                                    bool flg = false;
                                                    int  jj;
                                                    for (jj = 4; jj < pat.Count; jj++)
                                                    {
                                                        if (c == pat[jj])
                                                        {
                                                            flg = true;
                                                            break;
                                                        }
                                                    }
                                                    if (flg)
                                                    {
                                                        val += sk[jj];
                                                        if (int.Parse(val) > 100)
                                                        {
                                                            val = val.Substring(0, val.Length - 1);
                                                            break;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            co  = tmp;
                                            val = "100";
                                        }
                                        //<J color=",",%>のパターンで代入
                                        sb.Append(sk[1]).Append(co).Append(sk[2]).Append(val).Append(sk[3]);
                                    }
                                    else
                                    {
                                        //色の設定の取得に失敗した
                                        cl.logDebug(i + "行" + ii + "列:色の設定の取得に失敗した");
                                    }
                                }
                                istart = ii + 1;
                            }
                        }
                    }
                    ii++;
                }
                if (sb.Length > 0)
                {
                    sb.Append(lines[i].Substring(istart));
                    lines[i] = sb.ToString();
                }
                i++;
            }
            cl.logInfo("パターン4、いろの設定終了");
            sb.Clear();
            sk.Clear();
            pat.Clear();
        }
示例#12
0
        private void changeTag(List <string> lines)
        {
            //置き換える変換タグ組み
            ClassLog cl = new ClassLog(logPath);

            cl.logInfo("パターン5、置き換える変換タグ組み開始");

            List <string> sk  = new List <string>();
            List <string> ms  = new List <string>();
            List <char>   pat = new List <char>();

            getPat("5", sk, ms);

            foreach (string tmp in sk)
            {
                string[] sp = tmp.Split(SCHAR);
                if (sp.Length > 0)
                {
                    foreach (string s in sp)
                    {
                        pat.Add(convToInt32(s));
                    }
                }
                else
                {
                    //変換タグの設定情報のフォーマットが合っていない
                    cl.logDebug("変換タグの設定情報のフォーマットが合っていない");
                    return;
                }
            }
            sk.Clear();
            foreach (string tmp in ms)
            {
                string[] sp = tmp.Split(SCHAR);
                if (sp.Length > 0)
                {
                    foreach (string s in sp)
                    {
                        sk.Add(s);
                    }
                }
                else
                {
                    //変換タグの設定情報のフォーマットが合っていない
                    cl.logDebug("変換タグの設定情報のフォーマットが合っていない");
                    return;
                }
            }
            ms.Clear();
            if (pat.Count != sk.Count)
            {
                //変換タグの設定情報のフォーマットが合っていない
                cl.logDebug("対応タグの数が合っていない");
                return;
            }

            //変換を開始
            int           i = 0, ii, index;
            int           istart = 0;
            StringBuilder sb     = new StringBuilder();

            while (i < lines.Count)
            {
                char[] ch = lines[i].ToCharArray();
                sb.Clear();
                ii     = 0;
                istart = 0;
                while (ii < ch.Length)
                {
                    if (ch[ii] > INTCHAR)
                    {
                        index = pat.IndexOf(ch[ii]);
                        if (index >= 0)
                        {
                            sb.Append(lines[i].Substring(istart, ii - istart));
                            sb.Append(sk[index]);
                            istart = ii + 1;
                        }
                    }
                    ii++;
                }
                if (sb.Length > 0)
                {
                    sb.Append(lines[i].Substring(istart));
                    lines[i] = sb.ToString();
                }
                i++;
            }
            sb.Clear();
            cl.logInfo("パターン5、置き換える変換タグ組み終了");
            sk.Clear();
            pat.Clear();
        }