[Info-vax] Text processing on VMS
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Sun Oct 13 15:38:51 EDT 2024
On 2024-10-13 15:04:25 +0000, David Meyer said:
> I've got a text file with data that I want to select lines matching
> certain character strings, then extract string values from the selected
> lines by character position. On Unix, I would use awk or Perl. Does VMS
> have a similar tool, should I use my favorite programming language and
> call the STR$ RTL, can I write a TPU script to do this, or should I
> transfer the file to a Unix box and user awk or Perl? ;)
One-shot task?
Haul it over to an existing and working Unix, and "awk to it" there.
It'll be easier, generally. Easier, particularly if the text file
contains UTF-8, though this file is from OpenVMS so probably not.
For production use?
Other folks have listed various options to perform this task on OpenVMS.
Another option that seemingly wasn't mentioned is installing and using
GNV on OpenVMS. Obligatory vim and emacs reference.
The least-accretive and easiest-to-hand-off-to-others option on OpenVMS
is approximately a DCL LOOP: / READ / WRITE / GOTO LOOP procedure.
Which is a slog if unfamiliar with DCL, but is entirely doable.
If this file has some sort of internal organization or syntax, use of a
lib$table_parse grammar can be an option.
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list