• 数据格式化


    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();
                  */
           }
        }
    }
    
    
    
    
    
    
     
  • 相关阅读:
    四则运算的改进
    小学四则运算
    基于控制台的小学四则运算
    软件工程实践项目课程的自我目标
    课程总结
    个人作业 软件案例分析
    第一次技术博客
    结对第二次作业
    软工2
    软件工程第一次作业
  • 原文地址:https://www.cnblogs.com/songtzu/p/3579407.html
Copyright © 2020-2023  润新知