Article
· Jul 31 1m read
Import CSV into CACHÉ

Here's a practical example of how to import data from a CSV file into InterSystems CACHÉ using ObjectScript
Assuming your CSV file is simple (e.g., comma-separated, with headers), you can use %Stream.FileCharacter to read it line by line and parse the data.

ClassMethod ImportCSV(filePath As %String) As %Status {
Set stream = ##class(%Stream.FileCharacter).%New()
Set sc = stream.LinkToFile(filePath)
If 'sc Quit sc

2 0
0 16