Hello,
I have 50 text files in a directory called "AllFiles"
I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and append this information to the beginning of each text file.
For example, lets say i have 5 files in a directory in the "AllFiles" directory:
file1.txt ---has 500 lines
file2.txt ---has 600 lines
file3.txt ---has 550 lines
file4.txt ---has 700 lines
file5.txt ---has 480 lines
The result of the program should be this:
The first line of file1.txt should read: "there are 400 lines in this file and 100 bonus lines"
The first line of file2.txt should read: "there are 400 lines in this file and 200 bonus lines"
The first line of file3.txt should read: "there are 400 lines in this file and 150 bonus lines"
The first line of file4.txt should read: "there are 400 lines in this file and 300 bonus lines"
The first line of file5.txt should read: "there are 400 lines in this file and 80 bonus lines"
Is there any way that i can do this using the Microsoft Excel VB editor?
I don't have visual studio, but i do have the Microsoft office Visual Basic editor, and i have tried a few basic things to do this with no success.
Any ideas would be greatly appreciated.
If it matters, my computers operating system is Windows 7.
Bookmarks