473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

list the first file name in a directory vb.net 2005

20
Hello,

I have a directory with 26,500 files in it.

I need to parse each of these files and rename them.

To rename them I need to compare some parts of each file name to a look up table, take a value from the look up table and combine it with another part of the file name for the new file name.

Normally I would simply do the below:

Expand|Select|Wrap|Line Numbers
  1. Dim files() As String = Directory.GetFiles(“mydrectory”)
And it would populate an array with the file names, I could then loop through it.

But with 26,500 files this does not seem to be an available option.

I would instead like to do my loop based on “one file at a time” from the directory but have no idea how to get only one file name at a time, preferably the top most filename.

Any help would be great.

Thanks
Oct 10 '07 #1
2 2609
Plater
7,872 Expert 4TB
GetFiles() also takes search pattern string (*.txt for example)
That could be used to your benefit.
You could do "a*.*" and get all the files starting with an "a", then do the same for each starting character.
Oct 10 '07 #2
Javilen
20
GetFiles() also takes search pattern string (*.txt for example)
That could be used to your benefit.
You could do "a*.*" and get all the files starting with an "a", then do the same for each starting character.
It's a good idea, and I think I can use it to break my groups down into 1100 parts, but if there is a way to just take the first file found and work with it I would prefer this.
Oct 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JS | last post by:
I have a file called test.c. There I create a pointer to a pcb struct: struct pcb {   void *(*start_routine) (void *);   void *arg;   jmp_buf state;   int    stack; }; ...
1
by: Bob | last post by:
sWhen entering some functions, the definitions of the items in the argument list are displayed. For example when you enter "MID(" the definition of the first argument, STR, is shown and after...
11
by: Madison Kelly | last post by:
Hi all, I am new to the list and I didn't want to seem rude at all so I wanted to ask if this was okay first. I have a program I have written in perl which uses a postgresSQL database as the...
6
by: citlaly | last post by:
Hi!! I'm a beginner in python and I'm trying to use the files from a "folder" as a list. What I want to do is read each one as a list, but just the name of the file, the data inside doesn't...
2
by: xeshu | last post by:
HelowWw fellow programmers :) I have a web application that opens a pdf file. Very simple indeed. However the file name is not known. The file has to be found by first searching the list of all...
4
by: thoseion | last post by:
Hi, I am trying to get a program working whereby directory and file names are read into a list. I have been given the original list structure - it appears that the directory names should be added...
6
by: tgnelson85 | last post by:
Hello, C question here (running on Linux, though there should be no platform specific code). After reading through a few examples, and following one in a book, for linked lists i thought i would...
0
by: NatsoumiMaya | last post by:
hi ppl, i have a code to write in C where i have to implement the mkdir, rm, rmdir and touch functions using double linked lists...im haveing trouble with it...here is what i have so far: #ifndef...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.