zoukankan      html  css  js  c++  java
  • 数据格式化

    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();
                  */
           }
        }
    }
    
    
    
    
    
    
     
  • 相关阅读:
    CodeForces
    4.15随笔
    oracle新建用户并赋予权限等
    catch时,获取异常信息
    ORACLE 判断是否为数字类型
    UNION ALL用法
    2019.11.7随笔
    oracle 查询锁表和解锁
    2019.11.1随笔
    oracle拼接子查询返回的多个结果
  • 原文地址:https://www.cnblogs.com/songtzu/p/3579407.html
Copyright © 2011-2022 走看看