首页 > 其他 > 详细

数据格式化

时间:2014-03-04 17:07:28      阅读:474      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace convert
{
    class Program
    {
        static void Main(string[] args)
        {


            StreamWriter swWriteFile = File.CreateText("D:\\data\\data\\prsz.txt");
            string strReadFilePath = @"D:\\data\\data\\rsz.txt";
            StreamReader srReadFile = new StreamReader(strReadFilePath);
            // 读取流直至文件末尾结束
            while (!srReadFile.EndOfStream)
            {
                string strReadLine = srReadFile.ReadLine(); //读取每行数据

                swWriteFile.WriteLine(strReadLine.Substring(strReadLine.Length - 7, 6)); //屏幕打印每行数据
            }
           





           /*

            StreamWriter swWriteFile = File.CreateText("D:\\data\\data\\rsz.txt");
            string txt = "";
            StreamReader sr = new StreamReader("D:\\data\\data\\sz.txt", Encoding.GetEncoding("GB2312"));
            txt = sr.ReadToEnd();
            string[] arr = txt.Split(‘ ‘);
            for (int i=0;i<arr.Length;i++)
            { 
                swWriteFile.WriteLine(arr[i]);//写入读取的每行数据
            }
            swWriteFile.Close();
              */
       }
    }
}






 
bubuko.com,布布扣

数据格式化,布布扣,bubuko.com

数据格式化

原文:http://www.cnblogs.com/songtzu/p/3579407.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!