On 11 Sep 2006 06:06:56 -0700, "Chris Dunaway" <du******@gmail.com>
wrote:
>I'm trying to persist a list of filenames. I've made a custom
collection and a FileName class:
'Class to hold file name information
Public Class FileNames
Public fullName As String
Public fileName As String
Public fileExtention As String
Public filePath As String
Public newName As String
End Class
What is the purpose of the newName string? I ask this because you seem
to be re-inventing the wheel. What version of VS are you using? Why not
just use a generic List and the FileInfo class that is part of the
System.IO namespace?
Hello Chris.
Well, I'm using VS.net 2005.
I love to read. I sometimes get books from binary newsgroups and it's
gets tedious trying to organize my files in a format I can quickly and
easily scan through to find something of interest to me. So I thought
this was a perfect example of when I could put my limited programming
skills to use and to also further my knowledge of the VB.net language.
I have read about the FileInfo class and may end up using it more than
I currently do. The newName string will require a bit of an
explanation of what I'm trying to do.
My ebook files number over 15,000, currently on my hard drive. I have
a lot more stored on a dvd and I plan on organizing all them once I
get a few simple apps to help me with the effort.
This app is simply to help me try to conform some of the files names
to what a later app will then organize. Some filenames have multiple
consecutive spaces. Some have odd characters. Some are simply
misspelled. And some have strange, or odd name arrangement. Well,
here's some examples.
1) (ebook) - Pratchett, Terry - Discworld - 02 - The Light
Fantastic.txt
2) Terry_Pratchett_-_Discworld_- 02_-_The_Light_Fantastic.txt
3) Terry Pratchett - Discworld - 02 - The Light Fantastic.txt
4) Tery Pratchett - Discworld - 02 - The Light Fantastic.txt
5) Tarry Pratchett - Discworld - 02 - The Light Fantastic.txt
6) Pratchett, Terry - Discworld - 02 - The Light Fantastic.txt
To me 1-5 are wrong. At least by my current preference. In 1 through 5
I want my app to let me change all files to be similar to item 6. So
my app will let me choose the directories to load then I can scan
through my list of added filenames and find ones with something I want
or need to change. Then in a textbox I type in what I see that I want
either removed, rearranged, or replaced. Like replacing all
underscores with spaces and removing all consecutive spaces.
My next app will create folders for each author, like this:
Pratchett, Terry
pdf
htm
txt
Eddings, David
pdb
txt
And then even sub folders for file types. In fact as I go along I keep
thinking of new ideas and enhancements to what I currently want to do.
Like now I want the choice of Author Names or Extention to be
selectable. Having a folder with all txt ebooks and sub folders for
all authors with their respective books in their self named directory
would be really nice. Like:
TXT
Eddings, David
Pratchett, Terry
But all of this is also getting me more experience with VB.net and VS.
Sometimes it seems so overwhelming! At those times I'm very thankful
that I learned of newsgroups. In my opinion, discussion newsgroups are
one of the most valuable resources the net has to offer.
Now, the reason I do it this way is because I figured calling the
fileinfo (file system) as many times as could be needed would be too
costly. In fact, I now see that I don't even need to make a copy of my
original Queue. I can just load the changed name into the listbox and
allow it to continue to be updated until I'm done making all my
adjustments. Then it'll iterate through the whole list changing the
names as needed.
If you, or anyone, have any suggestions I'd be happy to hear them. I
know in programming there are usually too many different ways to go
about doing the same thing. So any advice is highly appreciated.
---
Kyote