4D Blog

Home Product 4D View Pro .CSV: New import/export format

4D View Pro .CSV: New import/export format

July 19, 2021

Product

Delimited files such as “.csv” or “.txt” are commonly used formats for importing or exporting data. Because delimited files can be generated and manipulated easily, more and more data published on the Web is tabular data, usually published as comma-separated values.

A good way to format this data and show it to your customers is to use 4D View Pro.

In 4D v19 R2, using the VP Import document and VP Export document commands that support delimited text file formats such as CSV, you can easily display that data for your clients.

The process is similar to importing and exporting Excel files, as described in the previous blog post: Work with .xlsx documents using 4D View Pro. You need to use the VP Import document and VP Export document commands to import or export delimited text files in 4D View Pro.

Importing A delimited text file

VP Import document supports the import of common CSV files that use a comma to separate values. The command automatically determines what sort of row delimiter is used in the file. In this case, you just need to indicate the path of the file and the cell where the data restitution begins:

$csvOptions:=New object
$csvOptions.range:=VP Cell("ViewProArea"; 5; 0)
VP IMPORT DOCUMENT("ViewProArea"; "c:\\tmp\\data.csv"; New object("csvOptions"; $csvOptions))

But all delimited text files are not CSV, so you can modify the column delimiter according to your needs. For example, if you need to import a text file with tab as value delimiter:

$csvOptions:=New object
$csvOptions.range:=VP Cell("ViewProArea"; 5; 0)
$csvOptions.columnDelimiter:=Char(9)
VP IMPORT DOCUMENT("ViewProArea"; "c:\\tmp\\export.txt"; New object("csvOptions"; $csvOptions))

exporting A delimited text file

VP Export document uses comma and  “\r\n.” as default values for column delimiter and row delimiter,  but you can specify your columnDelimiter and your rowDelimiter according to your needs:

$csvOptions:=New object
$csvOptions.range:=VP Cells("ViewProArea"; 5; 0; 2; 20)
$csvOptions.columnDelimiter:="|"
$csvOptions.rowDelimiter:="\n"
VP EXPORT DOCUMENT("ViewProArea"; "c:\\tmp\\data.txt"; New object("format"; vk csv format; "csvOptions"; $csvOptions))

More information is available in the doc center.

Discuss

Tags 4D View Pro, Document creation, Export, Import, Spreadsheet, v19 R2, v20

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • Email, Microsoft 365, Gmail
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • 4D Qodly Pro
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy