4D v16

データ読み込み

ホーム

 
4D v16
データ読み込み

データ読み込み    


 

 

ビデオ中で説明されている操作の他に、以下の点にも留意してください:

ブール値を読み込む際 (4DではTrue:False)、自動変換を設定できます:

  1. 読み込みダイアログ中いちばん右の設定タブをクリックし
  2. "yes;no"、"internal;external"、"Male;Female"などTrueとして読み込むデータとFalseとして読み込むデータを指定します。

4Dは読み込んだデータを自動で変換します (左側にマッチするデータがTrue、右側にマッチするデータがFalseになります)。

プログラムから読み込み、書き出しダイアログを表示させることもできます:

  •  IMPORT DATA("")
  •  EXPORT DATA("")

フォームを使用した読み込みを行う場合、フォームにはデータを受信するフィールドを配置します。フォーム上の入力順が読み込むファイルの列順と一致していなければなりません。

In this video, we'll learn how to create a table directly when importing data.

We have already imported data into the Interventions and Technicians table.

To save time and quickly retrieve existing information already entered in another database or in a spreadsheet, we are going to see how to create a table directly when importing data from a tab-delimited text file.

We'll perform an import like we did in previous videos.

  • "File" => "Import" => "From File..."
  • This display a list of all the files
  • And we can select "places.txt"

The import settings dialog box appears:

  • Click on "Create Table"
  • Then enter a name for the table
  • Then, in the 2nd tab named "Header", check the "Column Titles as Field Name" box

Fields are then created automatically and typed by default according to their contents.

Back on the 1st tab, we can still run into problems with accents so let's change the file and then we can indicate which type of field we want to set for each column.

  • Here, Alpha is fine
  • Alpha
  • Alpha
  • For the zip code, we recommend using Alpha
  • And for the City as well.

Once these settings are made, click on the "Import" button.

The data is imported and then 4D offers to create forms for this new table.

As we have done so far, we click on Yes.

There are other ways of importing available in 4D:

  • Import by forms
  • ODBC import
  • Importing data from former databases, through conversion
  • Connection to other databases
  • Programmed import

Using this same Import dialog box, File => Import => From File, you can import data using a form. We are going to simulate this without actually going through with it.

For example, in the places.txt file, we can import data using a form.

The idea is to create a specific form, dedicated to importing data where we have programmed object methods or the form method itself so that they perform automatic checking, reformatting or automatic filling in of calculated fields, etc. just as if the user was entering data directly in this form.

Later on in the programming, we can carry out imports using the Open document and RECEIVE PACKET commands, which we will see in another video.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: データ読み込み

 
履歴 

 
ARTICLE USAGE

セルフトレーニング ( 4D v16)