Hi. I'm happy to have found TableManager, and all is going well except that I'd like to import a CSV and end up with a Selection field. I've tried it two ways, with no luck:

1. I created the table first, defining a Selection column and values in the Selection box. I made sure that the values in my CSV matched the values in the Selection Box, but after I imported the CSV, every field in that column was empty. Is there something I could do differently to make that work?

2. I imported a CSV into a new table, and then tried to edit a column to change it from type = Text into type = Selection . The Type field was grayed out.

Any ideas? This is a pretty long CSV, so adding a new Select column after importing the CSV and selecting the values manually would be a real pain.

Thanks so much for any help you can offer.

- Riley

Comments

pobster’s picture

The choices are stored as an array in the header and then accessed via their sequential array numbering. So for instance;

Selection choices;

America
Used
To
Be
Cool

Equates to array(0 => 'America', 1 => 'Used', 2 => 'To', 3 => 'Be', 4 => 'Cool')

The database for entries will contain either 0, 1, 2, 3 or 4.

The reason for doing it this way is simple, one change to the header can potentially correct a spelling mistake for a million entries.

If I were you I'd simply open up your csv file in notepad and do a 'search and replace' according to the array position of your data.

1. Open the file in Notepad
2. Hit CTRL+H
3. Search for eg. "Used" (maybe match the case if that word appears anywhere else, or perhaps match ",Used,") with the replace string as eg. "1" or ",2," depending on what you did.
4. Erm... That's it.

Pobster

pobster’s picture

Status: Active » Closed (fixed)