473,461 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2836
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!
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.