Guest User

Untitled

a guest
Jan 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. using System.Collections;
  11. using System.Diagnostics;
  12.  
  13. namespace replace
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.         }
  21.  
  22.         private void button1_Click(object sender, EventArgs e)
  23.         {
  24.             string text;
  25.  
  26.             StreamReader sr = new StreamReader("c:\\replace\\4pp.csv");
  27.            
  28.             ArrayList line = new ArrayList();
  29.             while ((text = sr.ReadLine()) != null)
  30.             {
  31.                 line.Add(text);
  32.             }
  33.             StreamReader streamReader = new StreamReader("c:\\replace\\poep.txt");
  34.             string final = streamReader.ReadToEnd();
  35.             string newfinal = "";
  36.            
  37.             int i = 1;
  38.  
  39.             foreach (string plaats in line)
  40.             {
  41.                 newfinal = final.Replace(plaats, i.ToString());
  42.                 i++;
Add Comment
Please, Sign In to add comment