DEV Community

Judy
Judy

Posted on

3 1 1 1 1

How to Store Specified CSV Columns to a New File #eg77

Problem description & analysis

Below is data in CSV file csv.csv:

Image description
upc14 column is the logically unique index by which data should be ordered. Get this column and name column to store them as a text file as follows:

Image description
Solution:

We write the following script p1.dfx in esProc:

Image description
Code description:

A1   Read string type upc14 column and name column from the CSV file.

A2  Sort A1’s data by upc14 column.

A3  Export A2’s result to result.txt.

See How to Call an SPL Script in Java to learn about the way of integrating the SPL code with a Java program.

Open source SPL source address

Download

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay