18 this.AllowDrop =
true;
19 this.InitializeComponent();
27 private void MainForm_DragEnter(
object sender, DragEventArgs e)
29 if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy;
37 private void MainForm_DragDrop(
object sender, DragEventArgs e)
39 string[] files = (
string[])e.Data.GetData(DataFormats.FileDrop);
40 foreach (
string file
in files)
42 string[] importLines = File.ReadAllLines(file);
44 string directory = Path.GetDirectoryName(file);
45 if (directory == null)
48 string targetPath = Path.Combine(directory,
49 $
"{Path.GetFileNameWithoutExtension(file)}_out{Path.GetExtension(file)}");
51 File.WriteAllLines(targetPath, importLines.Select(line => line.Replace(
' ',
',')).ToArray());
MainForm()
Initializes a new instance of the MainForm class.
converts all whitespaces in a file to comma