# CSV to JSON using jFiles

**URL:** <https://clarionhub.com/t/csv-to-json-using-jfiles/7498>\
**Category:** tips\
**Created:** [September 26, 2024, 7:09pm UTC](https://clarionhub.com/t/csv-to-json-using-jfiles/7498 "2024-09-26T19:09:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [September 26, 2024, 9:16pm UTC](https://clarionhub.com/t/csv-to-json-using-jfiles/7498/2 "2024-09-26T21:16:01Z")

</div>

The Clarion DCT has great support for creating a Basic File Specification by reading a CSV. Then you can wizard a Process to read them all and code for JFiles. I would think Json.Save(CsvFile:Record,…more). I do not use jFile. You can also create a Report or Browse.

You can read CSV files string StringTheory but it does not handle quoted strings any where near as well as the BASIC driver without a bunch of odd code.

Here is some discussion:

> [@How to import CSV into Clarion 11 TopSpeed file without writing code](https://clarionhub.com/t/how-to-import-csv-into-clarion-11-topspeed-file-without-writing-code/3942/16):
>
> I thought that might be non 13,10 line endings so I tried a Unix (10) and MAC (13) file. The Wizard shows warnings below. The Mac file does not work and make a DCT file. The Unix file works, but did not set the Driver options to /ENDOFRECORD=10 /FIRSTROWHEADER=ON . Even though I config the Driver for 10 the Data Browser only shows the Header: (Edit: this was wrong, should have been /EndOfRecord=1,10 then everything worked.) The 13,10 file works

> [@Create a file layout from a CSV file](https://clarionhub.com/t/create-a-file-layout-from-a-csv-file/4232):
>
> Over on the Clarion 11 newsgroup Steve asked: Is there a quick way to get the file layout of a .csv file? I want to do some data processing on the csv and a .tps file. A couple of people quickly mentioned you could just import the file into the dictionary, although when setting the column widths it only checks the first 100 rows. Wolfgang mentioned: if you know the columns and if you know the delimiter, you could write a tiny tool with StringTheory, which parses the .CSV in advance an t…

---

_[View the full topic](https://clarionhub.com/t/csv-to-json-using-jfiles/7498)._
