5 Replies Latest reply on Oct 4, 2011 12:26 PM by philmodjunk

    Importing a value list from a text file

    GaryRemson

      Summary

      Importing a value list from a text file

      Product

      FileMaker Pro

      Version

      10

      Operating system version

      Mac OSX (Lion)

      Description of the issue

      I have emails being sent to me that have a text line with data I import to a Filemaker database. I would like to add a fixed value list data set to import. This value list exists in the database but I cannot figure out how to make the text file check off the proper values in that list. Soft returns like those created when I export a record creates multiple records when imported back in and I can't, for the life of me, figure out what else I can do. Can someone point out the flaw in my thinking. There must be a way to do this?

        • 1. Re: Importing a value list from a text file
          philmodjunk

          Which options are you using when you export this data to a text file? Csv, tab, merge?

          Or did you use Export Field Contents instead of Export Records?

          What options are you using when you import it?

          I'd like to try to replicate this in order to explore possible solutions, but need to know what options you have specified.

          • 2. Re: Importing a value list from a text file
            GaryRemson

            I am using a simple tab-delimited file. I have successfully used a copy and paste method from my emails to a tab-delimited file and then importing the tab-delimited file into the databse with no diffculties but it is my attempt to add the text to this tab-delimited file to specify which of the value list to "check" off that is causing problems. That was why I tried exporting the record with the value list values checked off and seeing how they exported to see how I might change my tab-delimited file. Problem being that what appears to be "soft returns" (or Control-K characters in the text file) from the export, do not work when I try putting them in myself into the file. There must be some kind of character that I can use to differentiate the value list choices within the tabs? Wouldn't you think? I know that I can't think?

            Thanks for the consideration and help.

            • 3. Re: Importing a value list from a text file
              philmodjunk

              I must be missing something.

              I defined a single text field and formatted it with a checkbox set with three values. I then went to browse mode and selected all three values.

              I exported the single record as a tab delimitted file.

              I then imported from this tab delimitted file. The data imported correctly with all three check boxes selected.

              How does this differe from what you are doing?

              • 4. Re: Importing a value list from a text file
                GaryRemson

                I guess I am not making myself clear.

                I am creating a tab-delimited file using Word (or any text editor) and wish to import that data into my database. One of the tab-delimited fields that I am importing to is a value list. I want to be able to vary the checked value list choices from this tab-delimited file that I create and import.

                The import and export from the same database was just an experiment to see how value list data was exported so that I might be able to edit my hand-made tab-delimited file for importing. I was not able to figure out what I could do by hand to make the value list importable (if there is such a word).

                Hope that cleared things up. Sorry for the confusion.

                • 5. Re: Importing a value list from a text file
                  philmodjunk

                  OK,

                  It might be simpler to create your value list with a format such as:

                  value1|value2|Value3

                  so you have a visible character separating each value instead of the invisible ones used when you export this data.

                  You can then do a simple character substitution after/during import to change the | characters into the needed return characters.

                  Substitute ( ValueListField ; "|" ; ¶ )

                  Will do the charcter substitution.

                  You can use replace field contents with this expression to update all the imported records in one go.

                  You can also import the text into a global field and use this expression in an auto-enter calculation if you enable auto-enter options during import. (Learned that trick from LaRetta...)