|
-
May 25th, 2007, 04:37 PM
#1
Thread Starter
Addicted Member
Multiple Files
Okay...
When i deploy my application, i will need about 2000 text files to go with it.
I have a list of names. In the format of:
'Forename Surname'
But i want to export that list into text files, so each file name will be like
'Surname, Forename.txt'
But i suppose i could go through the list and re-arrange the list.
Thanks 
- Adam
Edit: Also... Each file should contain:
Code:
Forename
Surname
N/A
N/A
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
//Initial Points\\
50
Last edited by adamlonsdale; May 26th, 2007 at 04:09 AM.
-
May 26th, 2007, 01:07 AM
#2
Re: Multiple Files
Create a file with just the info you posted then read thru the other file to create the file you want then append the info you read from the first file.
-
May 26th, 2007, 02:16 AM
#3
Re: Multiple Files
well if you have Excel installed you could import the text file separated with spaces, then switch the columns around and resave as .csv format.
rename the finished file appropriately. Note that there wouldn't be any spaces this way.
-
May 26th, 2007, 03:17 AM
#4
Thread Starter
Addicted Member
Re: Multiple Files
Hey there,
Okay i have swapped them about, and now i have the following Format:
Code:
Tindall, Emily
Tindall, Philip
Tomlinson, Christopher
Tomlinson, Sophie
Towle, Paige
Towner, Samuel
Towns, Daniel
Ture, Ana
Turner, James
Burgess, Scott
Twidal, Sam
Verity, Thomas
Waddy, George
Walker, Daniel
Ward, Jenna
Ward, Nicola
Ward, Rhys
Warsop, Amy
Watson, Sophie
Watts, Scott
Webster, Patrick
Whinham, Amy
Whitehead, Henry
White, Megan
Wilcock, Michael
Wilkinson, Bethany
Williams, Adam
How do i export each line as a .txt file? With the contents i wanted.
e.g a Batch Copy, Paste and Rename
-
May 26th, 2007, 03:22 AM
#5
Re: Multiple Files
Why not just have the installation process create the files. Create the file that has the data you want to deploy then copy it to the new names in code.
Read the csv file
rearrange the name to file name format
Copy the original data to that filename
FSO.CopyFile BaseFile, NewFilename
-
May 26th, 2007, 03:42 AM
#6
Thread Starter
Addicted Member
Re: Multiple Files
 Originally Posted by randem
Why not just have the installation process create the files. Create the file that has the data you want to deploy then copy it to the new names in code.
Read the csv file
rearrange the name to file name format
Copy the original data to that filename
FSO.CopyFile BaseFile, NewFilename
huh? I think i may have a slight idea, but if the CSV file is already rearranged, do i have to re-arrange it again?
-
May 26th, 2007, 03:45 AM
#7
Re: Multiple Files
If the names are in the correct order then you need to do nothing but remove the comma cause you can't have commas in the filename.
-
May 26th, 2007, 04:08 AM
#8
Thread Starter
Addicted Member
Re: Multiple Files
Are you sure?
Because i currently have 4 files which i tested the program with, and they all have commas?
And i have no clue how to do this, i just attempted it, but its because i want the forename and surname in the file aswell as the file name.
-
May 26th, 2007, 04:11 AM
#9
Re: Multiple Files
Then you will need to
Generate the file name
Open the file for output (create)
Write out the users name
Write out the remaining data contained in a byte array or string.
-
May 26th, 2007, 05:43 PM
#10
Re: Multiple Files
it coult be something like this
open "masterlist.csv" for input as #1
do
if eof(1) then exit do
line input #1, Name$
open name$ + ".txt" for output as #2
'output data here
print #2, datayouhavetostore
close #2
loop
close #1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|