- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: reading/writing <CR>s and <FF>s in DCL.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 07:37 AM
тАО08-04-2005 07:37 AM
Hi,
I've got a (not very elegant) script that strips formfeeds from a text file and I also need to strip crlfs but can't figure out how to insert the cr in the dcl procedure.
$ open/read infile file1.dat
$ open/write outfile file2.dat
$ read infile line
$ if line .ne. "ctrlL" (meaning a ff) then write outfile line
Our application dumps files with trailing crlfs at the end of every file. ctrl M doesn't insert the cr. I'm using edt but can try another as well. I saw a reference using tpu and some function key sequences but am unfamiliar with tpu.
We're sending these text files to a fax server and they're reciving lots of blank pages on the far end.
Thanks in advance,
Rusty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 07:53 AM
тАО08-04-2005 07:53 AM
Re: reading/writing <CR>s and <FF>s in DCL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 08:21 AM
тАО08-04-2005 08:21 AM
Re: reading/writing <CR>s and <FF>s in DCL.
Of course, the most elegant way to do it,is probably in Teco, but those neurons are failing...
It's also not clear what you are looking for. Do you a) want to turn multiple CRLF's into FF's, or b) delete extraneous FFs or c) delete final FF's.
PeterQ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 08:46 AM
тАО08-04-2005 08:46 AM
Re: reading/writing <CR>s and <FF>s in DCL.
I actually want to find them and strip them. I can find the form feeds no problem, that's a control l into the dcl command procedure that does the reading and writing. i just can't figure out how to get a CR in there. some of the stuff I saw said a ctrl M but that just does a "delete to begnning of line" or somesuch.
I'd love to use perl, however, time is short and my learning curve is steep!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 09:25 AM
тАО08-04-2005 09:25 AM
Re: reading/writing <CR>s and <FF>s in DCL.
When using EDT to create a dcl command procedure...
ctrl [[ =
ctrl l =
? =
Hope that helps...
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 09:27 AM
тАО08-04-2005 09:27 AM
Re: reading/writing <CR>s and <FF>s in DCL.
PF1 decimal-value-of-charcter PF1 KP3
so for a CR,
press the PF1 key (aka: the gold key)
type 13
press PF1
press the 3 on the keypad.
However, this makes the DCL file look strange when you type it, so you might want to consider instead using a value assignment like:
$ CR[0,8] = %X0D !hex zero D = dec 13
which places the hex value 0D into a symbol named CR.
However, however (;-) there's probably a easier and better way to make the file more fax-friendly.
Doug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 09:30 AM
тАО08-04-2005 09:30 AM
Solution$ open/read infile file1.dat
$ open/write outfile file2.dat
$ read infile line
$ line = f$extract(0, f$locate(CR,line), line)
$ if line .ne. "ctrlL" (meaning a ff) then write outfile line
I have just scribbled the above out and have not tested it, but it should truncate the line at the first carriage return in the line. If there is no carriage return in the line, it should leave the line unchanged.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 09:30 AM
тАО08-04-2005 09:30 AM
Re: reading/writing <CR>s and <FF>s in DCL.
in DCL, you define a symbol to be any ASCI char, by NUMERIC assign of 8 bits.
eg the Escape char (ASCI 27), using ther recognisable symbolname esc:
$ esc[0,8]=27
means "assign value 27 to 8 bits, starting from bit 0, of the symbol esc"
$ bell[0,8]=7 : bell signal
Synyax:
symbol name - (NO spaces!) - left square bracket - offset of first bit - comma - length in bits - right square bracket - equals sihn -
Now to insert it into a string, simply use string concatenation.
$ String = symbol1 + "Litteral" + string2 + string3 (etc...)
or
$ Strng := "''symbol1'litteral''string2'''string3' ..."
(single and double quotes unclear in presentation. Copy / paste into plain-text window for clarity)
Left to do: find ASCI numeric value of desired char.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 11:40 AM
тАО08-04-2005 11:40 AM
Re: reading/writing <CR>s and <FF>s in DCL.
Success! Many thanks to all who replied.
I took a roundabout way and am not looking for any carriage returns.
Dales note about using f$locate helped imensely. I'd forgotten about that.
I wanted to strip
so rather than checking for either two strings just check for existence of
open/read infile file1.dat
open/write outfile file2.dat
top:
read/end=cya infile line
a = f$locate("ctrll",line)
b = f$length(line)
if a .eq. b then write outfile line
goto top
cya:
close infile
close outfile
send file2.dat to fax server!
Still not elegant but it works. At least until our apps folks change the report layout again...
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2005 11:51 AM
тАО08-04-2005 11:51 AM
Re: reading/writing <CR>s and <FF>s in DCL.
$ edit/edt replace.com
then enter therein:
$ edit/edt file1.dat
s/
s/
exit
$ exit
where within edit/edt replace.com
and
if this should be replaced.
Cheers,
EW