TSE: Issue: grep.exe: Using parameter -f does not move to the search hit line when pressing <ENTER>

5 views
Skip to first unread message

knud van eeden

unread,
Dec 2, 2022, 8:52:32 AM12/2/22
to SemWare TSE Pro Text Editor
Hello,

Possible issue = Using parameter -f does not move to the search hit line when pressing <ENTER>

Tested with: clean installed latest TSE version 4.48

Steps to reproduce:

1. Create e.g. a file 

    c:\temp\foobar1.txt 

2. Add this example text to it and save the file:

a
a
a
a

3. Then run grep.s located in the TSE mac subdirectory:

mac\grep 

and fill in the dialog box in this data:

search = a 
files = c:\temp\foobar.txt
options = -f

4. then press <ENTER> to start the search, that will give this outcome:

c:\temp\foobar.txt:1: a

c:\temp\foobar.txt:2: a

c:\temp\foobar.txt:3: a

c:\temp\foobar.txt:4: a

5. Result: But then pressing <ENTER> on any of these lines
goes back to the original (other) file where you started to run grep.

6. Expected: Pressing <ENTER> on any of these lines should goto the file c:\temp\foobar.txt and to the line of that search result, e.g. line 2.

7. Note: As a side note: to quickly test this from the command line for different versions of TSE (e.g. 4.42, 4.43, 4.44, ...), use e.g. (where <TSE> is the main directory where TSE is installed)

<TSE>\g32.exe -emac\grep 

8. This behavior is also present in TSE 4.40a, thus probably unchanged since that previous official version until and including the latest TSE 4.48

with friendly greetings
Knud van Eeden





knud van eeden

unread,
Dec 2, 2022, 9:14:13 AM12/2/22
to SemWare TSE Pro Text Editor
Hello,

Possible issue = Using parameter -f does not move to the search hit line when pressing <ENTER>
when running the TSE macro 'grep.s'

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/semware/270640077.298970.1669989148008%40mail.yahoo.com.

knud van eeden

unread,
Dec 4, 2022, 3:10:36 PM12/4/22
to SemWare TSE Pro Text Editor
The reason that it does not work is thus that TSE grep.s expects always this format:

--- cut here: begin --------------------------------------------------
c:\temp\foobar1.txt
1: a
2: a
3: a
4: a
c:\temp\foobar2.txt
1: a
2: a
3: a
4: a
--- cut here: end ----------------------------------------------------

but receives in this case (and that is not handled by grep.s)

--- cut here: begin --------------------------------------------------
c:\temp\foobar1.txt:1       a
c:\temp\foobar1.txt:2       a
c:\temp\foobar1.txt:3       a
c:\temp\foobar1.txt:4       a
c:\temp\foobar2.txt:1       a
c:\temp\foobar2.txt:2       a
c:\temp\foobar2.txt:3       a
c:\temp\foobar2.txt:4       a
--- cut here: end ----------------------------------------------------

===

FYI:

So I have written a small program which converts the second format to the first format

See attached file: grepsemwaretse.s

That should work OK.

Note: I developed and used it e.g. in my 'grepsemware.s' in the case of GNU grep 
and could thus apply it also on TSE with -f afterwards.

with friendly greetings
Knud van Eeden

grepsemwaretse.s
Reply all
Reply to author
Forward
0 new messages