zoukankan      html  css  js  c++  java
  • C#在文本文件的每行后加分号

     

    Authorquietwalk

    Date2010-10-28


     

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Linq;

    using System.Text;

    using System.Windows.Forms;

     

    using System.IO;

     

    namespace ReadLine

    {

        public partial class Form1 : Form

        {

            public Form1()

            {

                InitializeComponent();

            }

     

            private void btnConvert_Click(object sender, EventArgs e)

            {

                string oldValue = string.Empty, newValue = string.Empty;

     

                StreamWriter writer = new StreamWriter(@"d:\\diccode_destination.txt", true,Encoding.Default);

                using (StreamReader read = new StreamReader(@"d:\\diccode_orginal.txt", System.Text.Encoding.Default,true))//txt 文件默认是 GB2312格式编码

                {

                   

                    do

                    {

                        newValue = read.ReadLine();

                        oldValue = newValue != null ? newValue+";" : oldValue;

                        writer.WriteLine(oldValue);

                    } while (newValue != null);

     

                    read.Close();

                    writer.Close();

                }

     

            }

        }

    }

  • 相关阅读:
    112、TensorFlow初始化变量
    111、TensorFlow 初始化变量
    110、TensorFlow张量值的计算
    109、TensorFlow计算张量的值
    108、TensorFlow 类型转换
    107、TensorFlow变量(三)
    106、TensorFlow变量 (二) reshape
    105、TensorFlow的变量(一)
    104、Tensorflow 的变量重用
    103、Linux 编译 Kaldi 语音识别工具
  • 原文地址:https://www.cnblogs.com/quietwalk/p/1863260.html
Copyright © 2011-2022 走看看