I'm now really confused and do not understand anymore what you want. I give you an example what I understand as a detailed description.
File open on script start is
C:\Temp\Test.lst containing following lines:
Code: Select all
11111-22222-33333-44444-55555
11112222333344445555
aaaaa-bbbbb-ccccc-ddddd-eeeee
11111-22222-33333-44444-55555
1111122222333334444455555
11112222333344445555
11111-22222-33333-44444-55555
The script is executed on
C:\Temp\ as entered by me. This directory contains 3 *.txt files.
C:\Temp\Test1.txt contains the lines:
Code: Select all
1111122222333334444455555
aaaaabbbbbcccccdddddeeeee
1111122222333334444455555
C:\Temp\Test2.txt contains the lines:
Code: Select all
11111-22222-33333-44444-55555
aaaaa-bbbbb-ccccc-ddddd-eeeee
1111122222333334444455555
C:\Temp\Test3.txt contains just the line:
The script produces currently for these files:
Code: Select all
----------------------------------------
Find '11111-22222-33333-44444-55555' in 'C:\Temp\Test2.txt':
C:\Temp\Test2.txt(1): 11111-22222-33333-44444-55555
Found '11111-22222-33333-44444-55555' 1 time(s).
Search complete, found '11111-22222-33333-44444-55555' 1 time(s). (1 file(s)).
Search complete, found '11112222333344445555' 0 time(s). (0 file(s)).
----------------------------------------
Find 'aaaaa-bbbbb-ccccc-ddddd-eeeee' in 'C:\Temp\Test2.txt':
C:\Temp\Test2.txt(2): aaaaa-bbbbb-ccccc-ddddd-eeeee
Found 'aaaaa-bbbbb-ccccc-ddddd-eeeee' 1 time(s).
Search complete, found 'aaaaa-bbbbb-ccccc-ddddd-eeeee' 1 time(s). (1 file(s)).
----------------------------------------
Find '11111-22222-33333-44444-55555' in 'C:\Temp\Test2.txt':
C:\Temp\Test2.txt(1): 11111-22222-33333-44444-55555
Found '11111-22222-33333-44444-55555' 1 time(s).
Search complete, found '11111-22222-33333-44444-55555' 1 time(s). (1 file(s)).
----------------------------------------
Find '1111122222333334444455555' in 'C:\Temp\Test1.txt':
C:\Temp\Test1.txt(1): 1111122222333334444455555
C:\Temp\Test1.txt(3): 1111122222333334444455555
Found '1111122222333334444455555' 2 time(s).
----------------------------------------
Find '1111122222333334444455555' in 'C:\Temp\Test2.txt':
C:\Temp\Test2.txt(3): 1111122222333334444455555
Found '1111122222333334444455555' 1 time(s).
Search complete, found '1111122222333334444455555' 3 time(s). (2 file(s)).
Search complete, found '11112222333344445555' 0 time(s). (0 file(s)).
----------------------------------------
Find '11111-22222-33333-44444-55555' in 'C:\Temp\Test2.txt':
C:\Temp\Test2.txt(1): 11111-22222-33333-44444-55555
Found '11111-22222-33333-44444-55555' 1 time(s).
Search complete, found '11111-22222-33333-44444-55555' 1 time(s). (1 file(s)).
And the output window contains the lines:
Code: Select all
Running script: C:\Program Files\IDM Computer Solutions\UltraEdit\scripts\FindLinesInTextFiles.js
========================================================================================================
Script succeeded.
The script should first detect duplicate lines in
C:\Temp\Test.lst. If there are no duplicate lines in active file on script start, the output window is simply not modified.
But if any duplicate line is found during script execution, the output window should be automatically made visible and list the duplicate lines as follows in the output window.
Found 3 duplicate lines in input list file. The duplicate lines are:
C:\Temp\Test.lst(1):
11111-22222-33333-44444-55555
C:\Temp\Test.lst(4):
11111-22222-33333-44444-55555
C:\Temp\Test.lst(7):
11111-22222-33333-44444-55555
C:\Temp\Test.lst(2):
11112222333344445555
C:\Temp\Test.lst(6):
11112222333344445555
The script should ignore the duplicate lines in input file and reformat the list of found lines to show finally following:
Code: Select all
----------------------------------------
C:\Temp\Test2.txt(1): 11111-22222-33333-44444-55555
Found '11111-22222-33333-44444-55555' 1 time(s) in 1 file(s).
----------------------------------------
Found '11112222333344445555' 0 time(s) in (0 file(s).
----------------------------------------
C:\Temp\Test2.txt(2): aaaaa-bbbbb-ccccc-ddddd-eeeee
Found 'aaaaa-bbbbb-ccccc-ddddd-eeeee' 1 time(s) in 1 file(s).
----------------------------------------
C:\Temp\Test1.txt(1): 1111122222333334444455555
C:\Temp\Test1.txt(3): 1111122222333334444455555
C:\Temp\Test2.txt(3): 1111122222333334444455555
Found '1111122222333334444455555' 3 time(s) in 2 file(s).
Something like that would make it clear for a script developer what the script should do and how to test it.