DataMagic Technical Column Vol.14

[Data sorting and file splitting section

Commentary

When processing business data, there are many "data sorting" steps. For example, data is sorted for various business processes, such as sorting product data by store or by business partner.

The typical flow of data sorting is to specify key fields in the data you want to sort, then sort (sort) it into separate files based on those key fields. While this may seem simple at first glance, coding it individually often requires complex programming, and the development time can often take longer than expected.

With DataMagic, you can easily sort data and distribute data by splitting files, simply by setting keys.

This TIPS will introduce an example of sorting a file containing data for multiple business partners by business partner and outputting the data to separate files. Note that in order to use this TIPS, DataMagic must be installed on your computer. For information on where to obtain DataMagic and how to install it, please refer to the separate article "Installing DataMagic."

How to operate

Step 1 - Prepare the source data

First, prepare the CSV data to be converted. Once the data is ready, save it in the following folder on the PC where DataMagic is installed.
C:\work\SAMPLE14\ (saved with the file name "in")

»Download the source data (Note: The sample file is in zip format. Please unzip it before use.)

Step 2 - Download and configure DataMagic script file

Download the script file below and save it in the folder where DataMagic is installed.
C:\work\SAMPLE14\ (saved as "sample14.igen")

Launch DataMagic management screen and import the downloaded script file into DataMagic. To import, click the [Import Management Information] icon under [Tools] on the start screen. Specify the downloaded file on the Import Management Information screen and click the Import button. The ID SAMPLE14 will then be registered on the Data Processing Information List screen.

»Download the script file (Note: The sample file is in zip format. Please unzip it before use.)

Step 3 - Run DataMagic

Double-click the data processing information ID SAMPLE14 registered in step 2 and check that the file names for the input and output settings are set correctly. Open the data processing information ID SAMPLE14 from the screen and click the "Execute" button at the top of the screen.

Step 4 - Check the execution results

When execution is complete in step 3, the files "out.0001", "out.0002", "out.0003", and "out.0004" will be created in C:\work\SAMPLE14\, which was specified in the output settings. Check them using an editor such as Notepad.

lastly

In this example, we only specified "Customer Code" for data sorting, but you can also specify multiple items and ascending or descending order. You can also specify any string, such as the customer name or conversion date, from the input data for the output file name.
Please download DataMagic trial version and try out the technical column explanations.

  • The trial version is free to use for 60 days.
  • After you sign up for the trial version, you will receive 90 days of free technical support.

DataMagic Column List

Related Content

Return to column list