Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
how can i read a specific line from a file,
without reading everything before it ?my problem is that i have no compiler to use, only DCL.
thanks,
- Asaf.

Asaf,
If the file is indexed, you can use the DCL READ command to access it by key.
Otherwise, there is no direct way to read the nth record in a sequential file (that is not a DCL restriction, it is a more general restriction of variable length sequential text files).
If you are looking for a record containing a particular string, you can use the SEARCH command to locate it, then process the output of SEARCH.
If you have no compiliers, you DO have the MACRO-32 compiler, which can be used (ok, it is assembler, but I want people to remember that it is included). Also, you can download JAVA and the various **IX tools, such as PERL at no charge from http://www.hp.com/go/openvms.
I hope that this is helpful.
- Bob Gezelter, http://www.rlgsc.com

well, the file is a text file..
i don't think it's indexed or anything.what is the MACRO-32 ? i never came across that on the OpenVMS, but that might be removed because it is a military computer,
which makes it unaccessible to internet as well.
so that takes out the java and perl etc.i've got an idea though.
tomorrow i'll give it a try and see if i can make it work.the entire idea is to just take out a block from a text file,
from an unknown location within the file.
is to locate the certain parameter i'm looking for,
and then take the 5-6 lines previous to it.now comes the problem i had,
i couldn't go back in the file after a READ,
otherwise i'd just go to selected lines,
what i intend to try is to output the SEA with line numbers into a file,
get the line number, and read empty buffers until like, 10 lines before the line number,
then to extract the 10 lines i need.isn't that something.
considering the tools i work with,
i'm doing some really good things..- Asaf.

yes, i am aware of that. but i need it to be automated.
otherwise i would've searched it with EDT or something like that..

Well, it works.
I used "sea /num/out=temp.tmp Myfile"
and read the line numbers, decreased 20 of the number, buffered the lines until the location i want,
and outputed to another file the 20 lines i needed.it's working perfectly. although i'd enjoy a F$SEEK(file handle,line number) infused in DCL...

Hi ,
Can you please explain the process in detail of retrieving some particular lines as this seems to similar to my requirement.I need to cross-check the files in VMS and the same file downloaded into windows by retrieving lines with a sort of search criteria
DV

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |