473,395 Members | 1,456 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,395 software developers and data experts.

Renaming thousands of pdf files with different filenames

1
I have thousands of pdf files in one folder and I need to rename it all. EXAMPLE, Filenames should be like this B100000_AICOR_20180209,B100001_AICOR_20180209, B100002_AICOR_20180209, B100003_AICOR_20180209.............what is the easiest way to rename all of this file?
THANKS!
Feb 9 '18 #1
1 2833
SioSio
272 256MB
Expand|Select|Wrap|Line Numbers
  1.         Dim Folder As String = "C:\Folder\"
  2.         Dim files As String() = System.IO.Directory.GetFiles(Folder, "*.pdf", System.IO.SearchOption.AllDirectories)
  3.         Dim Filename As String
  4.         Dim NewFilename As String
  5.         Dim i As Long = 0
  6.         For Each Filename In files
  7.             NewFilename = "B1" & i.ToString("00000") & "_AICOR_20180209" & ".pdf"
  8.             If Not System.IO.File.Exists(Folder & NewFilename) Then
  9.                 System.IO.File.Move(Filename, Folder & NewFilename)
  10.                 i = i + 1
  11.             End If
  12.         Next
  13.  
Dec 20 '19 #2

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

Similar topics

1
by: Dummy | last post by:
Hi, From the following web site http://docs.sun.com/source/816-6410-10/request.htm I have found how to access the elements of an HTML form from server-side Javascript. Using the "request"...
5
by: Robizzle | last post by:
I'm trying to write a simple console app that will rename all the files in a directory according to any rules supplied by a user during runtime. For example rename all *.jpg to *.jpeg. My problem...
1
by: Jaymac | last post by:
Hi folks I have some 1600 files where the first 7 characters of each file name is in the format "CN NNN ". I would like to be able to change these via a program to the format "CN-NNN-". The...
1
by: tromped | last post by:
How do I rename an file from access?
9
by: beary | last post by:
Given that I'm trying to automate the process of uploading 20-30 files at a time (and I have to do this regularly), and the filenames are always the same each time (eg. it's always file1.gif,...
1
by: Jack Maxwell | last post by:
Hope someone can help here. My brother has asked me if I can assist in renaming about 1500 midi files which are associated with a programm called Cubase SE. With that software installed he can...
1
by: GeoDW | last post by:
Hell All, I have looked around and not found the solution I am looking for within the old threads. Here is my problem: I have a directory full of .img and .rrd files that have long filenames...
6
by: Valentijn | last post by:
Hi, What I want to build is a simple database that just conatins a table with filenames (maybe hyperlinks). The problem is that I want to be able to fill the table using a form and drag and...
10
by: companion98 | last post by:
pls help.. (sh scripting) I have 3 files, file1 & file2 both have thousands of records of mobile numbers, while updatefile.txt is for the output. what i want to do is to compare the mobile field of...
2
by: rotaryfreak | last post by:
Hi, I was just wondering if it is possible to write a java program that will rename a whole bunch of .mp3 files? if it is possible, how would i go about doing that? thanks!
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.