Find_53.13 unable to find the very last word

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
AlexBene
Posts: 5
Joined: Wed Dec 18, 2013 12:35 pm

Find_53.13 unable to find the very last word

Post by AlexBene »

================================================================================
Find 53.13 (24/11/12)
================================================================================
Report_2014.02.17.0002_Find_53.13
By: Alexander Benedictov
[email protected]
================================================================================
Find 53.13 cannot find the very last word in a file

Search 52.1 (09/12/06) does find that word in a file.
================================================================================
For example, please copy this file to RAM:T and
try to find that file by the very last word using
Find and Search.
================================================================================
Abracadabra
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Find_53.13 unable to find the very last word

Post by nbache »

It works here, using my public (non-beta) installation with the same versions as yours:

Code: Select all

$ echo >T:Testfile "This is a test of finding the last word."
$ echo >>T:Testfile "The last word in the last line."
$ search T: line quick
RAM Disk:T/Testfile
     2 The last word in the last line.
$ find T: contents line
Testfile                        73 ----rwed 18/02-2014 23:07:09 T: 
$ search T: line. quick
RAM Disk:T/Testfile
     2 The last word in the last line.
$ find T: contents line.
Testfile                        73 ----rwed 18/02-2014 23:07:09 T: 
$ version `which search` file full
Search 52.1 (09/12-2006)
$ version `which find` file full
Find 53.13 (24/11-2012)
$ 
As you can see, I even tried searching both with and without the final full stop.

In all cases, the file is found.

Anything I have overlooked that we are doing differently?

Best regards,

Niels
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1483
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Find_53.13 unable to find the very last word

Post by tonyw »

It may be that the last line in the file (or the only line) is not terminated with a NL. I have noticed some applications like NotePad (and its derivatives) can not find a string on the last line unless the last line has a NL character.
cheers
tony
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Find_53.13 unable to find the very last word

Post by nbache »

Bingo - that's it!

I just repeated the above test, but with an added NOLINE on the second echo statement.

This showed the issue perfectly; Seach could find the file, but Find couldn't.

I have now made a BZ entry for this.

Thanks for reporting, AlexBene! (And Tony for the hint ;-)).

Best regards,

Niels
Post Reply