You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
Say you have a text file with a bunch of HL7 messages. Each segment ends with \r. And each message ends with \r\n. Here’s the file attached:
You could use the simulator component - but honestly it’s probably easier to write you own little component.
Use a custom field for the input file name
See Custom Fields Here we use ~/test.txt for the default location of the input file.
You access that with:
local FileName = component.fields()
Read in the file using the FIL library with FILread
The FIL library makes it really easy to inhale the file:
local Content = FILread("main.lua");
Examine the file contents in the translator - each segment ends in \r but the message ends with \n characters
We can easily see by looking at the contents of the file using the Escaped Text mode:
that have a custom field for filename, can read in the messages, split them and push them into a queue.
Then it’s super easy to push test data into your interfaces from that - more straightforward that other techniques.