# Import 100 text files

**URL:** <https://the.fmsoup.org/t/import-100-text-files/2929>\
**Category:** Questions\
**Tags:** community\
**Created:** [May 27, 2022, 10:46am UTC](https://the.fmsoup.org/t/import-100-text-files/2929 "2022-05-27T10:46:21Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 27, 2022, 10:46am UTC](https://the.fmsoup.org/t/import-100-text-files/2929/1 "2022-05-27T10:46:21Z")

</div>

If I have, say, 100 text files with the same data format, is it possible to have FileMaker import these in a batch -- no user interaction? I don't see how to select more than one file at a time for an import.  
Thanks

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [May 27, 2022, 10:57am UTC](https://the.fmsoup.org/t/import-100-text-files/2929/2 "2022-05-27T10:57:58Z")

</div>

You could use e.g. Files.List in MBS Plug-in to get a list of files.  
Then loop over them.  
Build file path, do import of file.  
A function like Container.ReadFile can help.

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [May 27, 2022, 11:06am UTC](https://the.fmsoup.org/t/import-100-text-files/2929/3 "2022-05-27T11:06:27Z")

</div>

If you can generate the list of the files, and loop through them, putting them into a variable. The file import step will allow you to use the variable as the source.

---

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 27, 2022, 11:40am UTC](https://the.fmsoup.org/t/import-100-text-files/2929/4 "2022-05-27T11:40:06Z")

</div>

So "no", there is no _automated_ batch import.

That's what I needed to know.

Thank you!! 🙂

---

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 27, 2022, 11:41am UTC](https://the.fmsoup.org/t/import-100-text-files/2929/5 "2022-05-27T11:41:15Z")

</div>

I have HUGE files.

To solve this, I just wrote a program to concatenate all of them into a single file and use that. Resultant text file is over 7 GB.

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [May 27, 2022, 7:38pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/6 "2022-05-27T19:38:41Z")

</div>

If you have huge files, pre-processing is highly recommended. Have the files in exactly the right shape for import, including meta data fields, so that you can switch off the "auto-enter" options on the import dialog.

Another thing to consider is that Filemaker would rather do many short bursts of activity than a sustained large activity. Plan for a sprint not a marathon. If you run server side scripts to control the import of many small files you will get better performance.

---

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 28, 2022, 10:56am UTC](https://the.fmsoup.org/t/import-100-text-files/2929/7 "2022-05-28T10:56:24Z")

</div>

Thank you @Malcolm 🙂

---

<div class="post-metadata">

**Author:** ![menno](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/menno/32/2016_2.png) [@menno](https://the.fmsoup.org/u/menno)\
**Post date:** [May 28, 2022, 3:19pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/8 "2022-05-28T15:19:55Z")

</div>

You can put your textfiles into a designated folder and batch-import them from there and you can script that:

 ![Schermafbeelding 2022-05-28 om 17.16.35](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/9/9860b55709993eded337f3b38fdab3c672c0f4c5.png)

 ![Schermafbeelding 2022-05-28 om 17.17.09](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/1/1a0a6bf813b913980af49de95be8710c5909df70.jpeg)

Very easy, native FileMaker 🙂

---

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 28, 2022, 4:22pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/9 "2022-05-28T16:22:38Z")

</div>

So if I had 100 files like "File1", "File2", .... "File100" would each file go into its own table or could I specify that all 100 files are for the same table? Not clear from the dialog. Thanks.

---

<div class="post-metadata">

**Author:** ![menno](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/menno/32/2016_2.png) [@menno](https://the.fmsoup.org/u/menno)\
**Post date:** [May 28, 2022, 5:11pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/10 "2022-05-28T17:11:05Z")

</div>

Well you do need to do a little more work. I've included an example which is very rough, but it demonstrates what you can do  
[ImportFolderWithTextfiles.zip](https://the.fmsoup.org/uploads/short-url/eoJ0erwisUyXEPEf0jisQJn3olJ.zip) (148.4 KB)

---

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 28, 2022, 6:17pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/11 "2022-05-28T18:17:34Z")

</div>

That's cool thanks.

I already got it all working by concatenating all the files into a single file (\>1 Billion text file lines!).

---

<div class="post-metadata">

**Author:** ![menno](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/menno/32/2016_2.png) [@menno](https://the.fmsoup.org/u/menno)\
**Post date:** [May 28, 2022, 6:20pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/12 "2022-05-28T18:20:49Z")

</div>

Yes I did read that, but that would not be automation (but you could write an applet that concatenates all files in a folder) 😁

---

<div class="post-metadata">

**Author:** ![OliverBarrett](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@OliverBarrett](https://the.fmsoup.org/u/OliverBarrett)\
**Post date:** [May 28, 2022, 6:44pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/13 "2022-05-28T18:44:35Z")

</div>

I didn't combine the text files _manually_ in a text editor. LOL. 🙂

I wrote code to do that combination, just not FileMaker code. Since this is a one-time import, it didn't need to be totally automated (as in recurring imports). There were several things the concatenation code needed to do, like quote the fields, remove blank lines, and filter out some other stuff.  
The code was very fast. 30 files each having about 500,000 lines all combined into a single file in about 70 seconds.

There were eight files in all, so over 1 Billion lines concatenated, _programmatically_..

Thanks again.

---

<div class="post-metadata">

**Author:** ![LVZ](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@LVZ](https://the.fmsoup.org/u/LVZ)\
**Post date:** [June 1, 2022, 12:50pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/14 "2022-06-01T12:50:36Z")

</div>

Not in it´s own table, but every file is in a container field in a record of its own. I did not really undeerstand what your question means 🙂

---

<div class="post-metadata">

**Author:** ![pfro](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/pfro/32/1815_2.png) [@pfro](https://the.fmsoup.org/u/pfro)\
**Post date:** [June 2, 2022, 6:34pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/15 "2022-06-02T18:34:00Z")

</div>

Oliver..  
no.. each file in its own RECORD.. not TABLE.. it seems to me EXACTELY what you where searching for. Ok.. if you prefer all on one big bloob.. in one Record.. you preprocess and create one file, with applescript, python or whatever tool.. But your question " is it possible.. .100 files.. all text.. batch import".. is answered here.. Yes.. just have them in one folder and import that folder.

---

<div class="post-metadata">

**Author:** ![mike275](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mike275](https://the.fmsoup.org/u/mike275)\
**Post date:** [June 2, 2022, 8:34pm UTC](https://the.fmsoup.org/t/import-100-text-files/2929/16 "2022-06-02T20:34:43Z")

</div>

Nice implementation, I ve never needed to use the data files commands, finally I see a usability for them
