Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: editing a txt file using a com file

Original Message
Name: VMS_fish
Date: February 22, 2008 at 14:41:15 Pacific
Subject: editing a txt file using a com file
OS: VMS 7.3
CPU/Ram: a
Model/Manufacturer: a
Comment:
I want to create a command file that can open a text file, find a specific word, edit it and save the new text file using lexical functions - is there an easy way to do this?


Report Offensive Message For Removal

Response Number 1
Name: Bob Gezelter
Date: February 22, 2008 at 16:26:49 Pacific
Subject: editing a txt file using a com file
Reply: (edit)
VMS_Fish,

I won't write the code for this simple example, but it is straightforward enough to make some observations that will point you to the appropriate HELP text on your system:

- OPEN/READ, OPEN/WRITE
- CREATE
- CLOSE
- READ, WRITE
- lexical functions F$EXTRACT, F$LOCATE

Other than the syntax, this is the classic "read a line, do some processing, write a line" example. The one unusual aspect, that is missed by many at first, is that DCL creates file with Printer Carriage Control by default. If one uses CREATE the output file, and then do an OPEN/APPEND, one creates a normal, plain text file.

- Bob Gezelter, http://www.rlgsc.com


Report Offensive Follow Up For Removal

Response Number 2
Name: HakZan
Date: February 23, 2008 at 03:00:15 Pacific
Subject: editing a txt file using a com file
Reply: (edit)
Why do you specificly ask for use of lexicals ?

You can use the "substitute"-command in EDT.

$ EDIT/EDT filename
SUBSTITUTE/old word/new word/ALL
EXIT
$ EXIT

This sequence substitute all "old words" with "new words" in the specified file.

But if you don't know if the "old word" exist, then you have to OPEN the file, READ it line by line, use F$LOCATE to locate the specific word on each line.......and so on.

regards,

Hakan Zanderau
HA-solution


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: editing a txt file using a com file

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC