Importing and exporting txt files in+out of microsoft access

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
Post Reply
User avatar
Mysteryem
Global Moderator
Global Moderator
Posts: 728
Joined: 22 Sep 2008, 19:44
Location: UK
Contact:

Importing and exporting txt files in+out of microsoft access

Post by Mysteryem »

Hi, I've found out that microsoft access is a fairly easy way to help modders with text editing, I have included a lengthy and a small step by step guide to allow you to import and export your txt files into and out of access. Have fun modding ;)

(I have an old version of access so it might not be exactly the same in newer versions)
Importing Warzone's txt files.(First of all you will have to extract the txt file you want from the wz file it's in)

Open access and click "new". Click "Blank database", now name it and save it as you want to. Once it's created click File,Get External Data,Import. In the "Files of type" box scroll down and click on "Text Files". Once you've done that browse until you find the warzone txt file you want to import. After this the Import Text Wizard will pop up, you will want to select the Delimited option (not Fixed Width), click "Next >". On this screen it will allow you to choose the delimiter that separates your fields, you will want to select Comma, also while you are at this screen, make sure that the box that says "First Row Contains Field Names" is unchecked and that the text qualifier is set to none, then click "Next >". In this screen you will have to make sure that it is created in a new table, simply click the box next to "In a New Table" and then click "Next >". Now you have entered the screen where you change the names of the fields. Clicking the "Advanced…" button will make it easier to change the field names, refer to http://wiki.wz2100.net/Txt_Editing for field names. After the fields have been named click "Next >". In this screen make sure that no primary key is being made and click "Next >". Finally on the last screen you can set the name of your table, I recommend giving it the same name as the txt file you used to import the data from as it will make it easier later on. Click "Finish" and your table will be ready to go.

Exporting the table to a txt file.

When you have the table loaded, click File,Export. When the box comes up you will want to change the "Save as type:" box to "Text Files". Then name it (providing you kept the file the same name as the orginal txt file ignore this step) so it has the same name as the original txt file and click "Export All". when the screen pops up you will want to select "Delimited" and click "Next >". The delimiter you want will want will be the comma and you must change the "Text Qualifier" to "{none}", also, the "Include Field Names on First Row" box must be unchecked, after this click "Next >". Finally choose where you want to export the file and click "Finish".

Step by step import: (NEXT=Click the 'Next' button)
1)Click "New"
2)Click "Blank database"
3)Click "File","External Data","Import"
4)Choose Text files as the type of file
5)Browse for the file and import
6)Select "Delimeted" NEXT
7)Choose "Comma" delimiter
8)Uncheck "First Row Contains Field Names"
9)Set text qualifier to "{none}" NEXT
10)Click new table NEXT
11)Click "Advanced…"
12)Name the fields NEXT
13)Select "No Primary Key" NEXT
14)Name the table FINISH

Step by step export: (NEXT=Click the 'Next' button)
1)Click "File","Export"
2)Set file type as "Text Files"
3)Name the file
4)Click "Export All"
5)Select "Delimited" NEXT
6)Choose "Comma" delimiter
7)Uncheck "First Row Contains Field Names"
8)Set text qualifier to "{none}" NEXT
9)Choose where to export FINISH
Last edited by Mysteryem on 15 Nov 2008, 12:46, edited 2 times in total.
"...If pure awesomeness were bricks, this would be the Great Wall of China...
The glory of this has collapsed on its self so far, that even the neutrons have collapsed."
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Importing and exporting txt files in and of microsoft access

Post by Zarel »

...um. Allow me to explain my method of importing and exporting the text files in and out of Microsoft Excel (also works in Gnumeric and OpenOffice.org Calc). I think it's much easier. This is all before the migration to SQLite, of course, which will render the whole exercise moot.

Step by step import
1. Rename the file from '.txt' to '.csv'.
2. Open the file.

Step by step export
1. Rename the file from '.csv' to '.txt'.
User avatar
Mysteryem
Global Moderator
Global Moderator
Posts: 728
Joined: 22 Sep 2008, 19:44
Location: UK
Contact:

Re: Importing and exporting txt files in and of microsoft access

Post by Mysteryem »

Well, that is far easier, I didn't know you could do that. Well, at least I know how to import and export with excel now, thanks :D .
"...If pure awesomeness were bricks, this would be the Great Wall of China...
The glory of this has collapsed on its self so far, that even the neutrons have collapsed."
Post Reply