Importing Multiple CSV Files

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Dave 1 year, 8 months ago.

  • Author
    Posts
  • January 5, 2018 at 12:53 AM #26857

    Dave
    Participant

    I am creating a database of records from notes I originally kept in Evernote. I exported them to HTML files, then converted the HTML files to TXT files. What I want to do is import these into Tap Forms so that each file becomes a record, and each line becomes a field.

    I tried to convert the TXT files into tab-separated TSV files (converting lines to tabs using TextWrangler), then merging them all into one file, but the merge method I used in Apple Terminal just gave me one continuous block of tabbed information, without any way to separate each record.

    Any suggestions?

    January 5, 2018 at 3:34 AM #26858

    Brendan
    Keymaster

    Hi Dave,

    You need to make sure that each record is separated by a linefeed. The tabs will separate the fields, but the linefeeds will separate the records.

    Then you’ll be able to import the file into Tap Forms.

    January 5, 2018 at 3:59 AM #26859

    Dave
    Participant

    Any ideas on how to convert a folder full of text files to a single CSV file where each file is separated by a linefeed?

    January 5, 2018 at 12:13 PM #26861

    Brendan
    Keymaster

    A bit of Googling turned up this command you should paste into a Terminal window:

    for f in *.txt; do (cat "${f}";) >> finalfile.txt; done

    If you’ve got CSV files, replace txt with csv.

    I tested it and it turned 3 files I had into one file with a line break in between each file.

    January 5, 2018 at 6:05 PM #26871

    Dave
    Participant

    Great! I actually found a similar script, but it worked. One more quick question… if I import a field that contains number values from 1 to 10, can I import that data into a Ratings field?

    January 5, 2018 at 7:21 PM #26874

    Brendan
    Keymaster

    Yes, you can. A Rating field is no different than a regular Number field except in the way it displays the data. The rating values are stored as numbers and not as stars.

    January 5, 2018 at 9:35 PM #26877

    Dave
    Participant

    Great! Thanks, Brendan.

You must be logged in to reply to this topic.