FD edlin ignores a leading space. If you want the leading space to be searched for, put the string in quotes; e.g.
1r"written"," written"
The reason why I didn't stick a ^Z there is because I wanted to get away from control characters in the commands, and a comma just looks better, IMHO.
Gregory
> On 01/22/2024 12:06 PM EST Bret Johnson via Freedos-devel <freedos-devel@lists.sourceforge.net> wrote:
>
>
> > I'm using the "r" (replace) instruction correctly: 1rfrom,to will
> > start at line 1 and replace "from" with "to".
> >
> > But it looks like a leading space is ignored, so edlin treats my
> > "1rwritten, written" as just "1rwritten,written" and seems to ignore
> > it because the "from" and "to" strings are the same.
> >
> > FYI: I can add a space in the middle of a replaced word, such as:
> >
> > *1rtext,te xt
> > 1: This is a plain te xt file,written in edlin.
> >
> > Is "ignore leading spaces after the comma in the 'r' command" the
> > expected behavior from MS-DOS edlin?
>
> I haven't used EDLIN in a LONG time (decades), but just did an experiment with MS-DOS 7.1 EDLIN. Your problem doesn't seem to be unrecognized spaces, it seems to be that you're not using any sort of "escape" character to separate your input and output strings. I believe you think the comma should be the "escape" character and it isn't. There's a similar issue with programs like SED and AWK/GAWK.
>
> When I'm in EDLIN (at least the one with comes with MD-SOD 7.1) and I type "?" to get help, the syntax for the Replace command looks like this:
>
> Replace [startline][,endline][?]R[oldtest][CTRL+Znewtest]
>
> It expects you to use a Ctrl-Z (end-of-file character) as the "escape" character.
> If I use the Ctrl-Z "trick" I can replace things like you're wanting to do.
>
> I do not remember if earlier versions of EDLIN did this or not, nor do I know how FD-EDLIN works.
>
>
> _______________________________________________
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/freedos-devel
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel