# SWAG Import Wizard

This wizard is used to enable you to import packets from the SWAG Database into your code snippets database. (A SWAG packet is roughly the equivalent of a CodeSnip snippet: packets are converted into snippets before being imported.)

The wizard is accessed from the Snippets | Import Snippets From SWAG menu option.

## Page 1: Import packets from SWAG as new snippets

This page gives an overview of how to use the wizard.

The wizard requires that you have a suitable copy of SWAG stored on your computer. If you haven't yet got it then you need to download it before continuing. The instructions shown in the box on this page of the wizard explain how to do this.

When you are ready, click the Next button.

## Page 2: Select SWAG database download folder

On this page you need to provide the full path to the SWAG database on your system. By default the required folder is the `swag` sub-directory of the folder where you extracted the SWAG zip file.

Enter the path in the edit box. You can click the ellipsis button to the right of the edit box to display a standard browse for folder dialogue box and choose the folder from there. The chosen folder will be entered into the edit box for you.

Once you have entered the path click Next. The data in the folder will then be read and, if valid, the next page of the wizard will be displayed. A progress bar may be displayed if the process of reading the data takes some time. If the data is invalid an error message will be displayed and the page will not change.

## Page 3: Select required packets

When this page is first displayed it displays all the categories of packets available in the SWAG database in the SWAG categories list box.

Choose a category in the list and click the Show Packets In Category button to display a list of its packets in the right hand list box. Alternatively just double-click the category name. The first time you choose a category the wizard will read the list of packets from the database and a progress bar may be displayed while this is done.

Select any packets you want to import by ticking the check box next to the packet's name. If you want to preview the packet before deciding whether to import it, highlight it and click the Preview Selected Packet button. Alternatively just double click the packet name. The packet will then be read from the database (if necessary) and displayed in a dialogue box.

Repeat this process for further categories if you wish. When you are ready to import your chosen packets click the Next button to display the next page. Note that you must select at least one packet in order to move on.

Warning: Do not select too many packets to be imported at one time because the import process is not very efficient and can take a long time.

## Page 4: Ready to import

This page lists all the packets you have selected for import along with the unique ID (i.e. snippet name) that will be assigned to the CodeSnip snippet after import. Note that some packets may need to be retrieved from the SWAG database when the page is displayed and a progress bar may be displayed while this happens.

You should review your selection. If you want to make any changes use the Back button to go back to the previous page and de-select any unwanted packets or select any you may have missed.

When you are ready to proceed, click the Import button. Once Import has been clicked the wizard will perform the import – there is no going back. A dialogue box will be displayed while the import proceeds. When the import has finished the final page of the wizard will be displayed.

## Page 5: Import complete

This page simply confirms the import has completed. All the selected packets will have been converted to snippets and imported into the same special category, the name of which will be displayed.

Click the Finish button to close the wizard.

The imported snippets are fully editable like any other user defined snippet.

Warning: CodeSnip does not track packets imported from SWAG, so if you import the same packet more than once a duplicate snippet will be created for it in your local database – the original will not be overwritten. You will not be warned about such duplications.