5701
General Software Discussion / Re: automate database building
« Last post by Renegade on April 26, 2012, 01:13 AM »Re-reading, I think I misunderstood before.
Are you simply looking to match chemical names, e.g. "chemical name", to the PDFs as in "chemical name.pdf"?
Here's a quick hack that will let you paste in a word list and check 1 folder:
ChemicalPdfCheck.exe (9.5 kB - downloaded 401 times.)
But that's all it does. It's VERY simple.
I don't have time right now to do much more, but here's what it is in case anyone wants to continue after you verify that it's the kind of thing you're looking for. (Maybe I can finish later.)
Here's the code for the 1 method to check:
Are you simply looking to match chemical names, e.g. "chemical name", to the PDFs as in "chemical name.pdf"?
Here's a quick hack that will let you paste in a word list and check 1 folder:

But that's all it does. It's VERY simple.
I don't have time right now to do much more, but here's what it is in case anyone wants to continue after you verify that it's the kind of thing you're looking for. (Maybe I can finish later.)
Here's the code for the 1 method to check:
Code: C# [Select]
- private void button1_Click(object sender, EventArgs e)
- {
- DialogResult dr = folderBrowserDialog1.ShowDialog();
- if (dr != System.Windows.Forms.DialogResult.OK)
- {
- return;
- }
- // display the selected path
- textBox2.Text = folderBrowserDialog1.SelectedPath;
- // find the files that are missing
- foreach (string s in textBox1.Lines)
- {
- if (File.Exists(folderBrowserDialog1.SelectedPath + @"\" + s + ".pdf"))
- {
- // do nothing
- }
- else
- {
- // got a missing file - add it to our list of missing ones
- textBox3.Text += s + "\r\n";
- }
- }
- }