Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.
Mofi wrote:it is better to include also the zip postal code for security if two different cities have the same name.
/*! This macro uses the UltraEdit regular expression engine. But any other
engine could be used too if the regular expression search strings would
be translated for the Unix or Perl regular expression engine. !*/
// Use user clipboard 9 for copying data and as variable storage buffer.
/*! File "base_with_www17nov.sql" must have the focus. The format
of the data in this file is:
But needed is only the city name and the website in the reverse order.
So a regular expression replace all is used to transform the data into
The regular expression search string means following:
% ......... string must be found at start of a line.
|start| ... just a simple string with no special meaning.
^(*|^) .... following |start| 0 or more characters can occur of any
type except the new line characters CR and LF until the
character | is found. This string - the website - is
tagged (stored in a temporary variable 1) for the
usage in the replace string referenced by ^1.
^(*|^) .... same as above, but now finds the city name and stores
this found string in a temporary variable 2 referenced
by ^2 in the replace string.
end| ...... again just a simple string with no special meaning. !*/
Find RegExp "%|start|^(*|^)^(*|^)end|"
Replace All "|^2^1"
/*! The data in file "base_with_www17nov.sql" contains the data now
in the required format. Select all the content, copy it into user
clipboard 9 and close the file without saving the changes. That
changes also the focus to the file "base_without_www_17nov.sql". !*/
/*! Paste the content of file "base_with_www17nov.sql" now at top of
file "base_without_www_17nov.sql". The cursor is now at the end
of the inserted data. If the cursor is not at start of the first
line of the real content of "base_without_www_17nov.sql", the last
line of file "base_with_www_17nov.sql" has had no line termination.
So insert a line termination + character # in an additional line.
Otherwise insert just a line with character #. !*/
/*! This regex replace creates a copy of every city name at start
of every line in file "base_without_www_17nov.sql". See end of
the macro for the reason why this is done. !*/
Find RegExp "%^(|*|*|*|*|*|*|*|*|*|*|*|*|*|^)^(*^)|"
Replace All "^2^1^2|"
/*! Now run from top of the file in a loop the required replaces. The loop
is exited when the cursor reaches the special line inserted before
starting with character #. This line is deleted when reached. !*/
/*! Inside the loop first select the |city name| of the current line copied
from the first file "base_with_www17nov.sql" and copy this string into
user clipboard 9. !*/
Find RegExp "%|*|"
/*! Stop selection mode, move cursor back to start of the line, start
selection mode and move cursor to end of the line. Now the whole
line |city name|website| is selected. !*/
/*! Use a non regular expression replace to find all occurences of the
just copied |city name| with the dummy text website| following
and replace all occurences from current cursor position to end of file
with the current selection. So with this method all cities present in
file "base_with_www17nov.sql" will have then also the website string
in file "base_without_www_17nov.sql". !*/
Replace All "^s"
/*! Replace all does not change the cursor position. So the cursor is still
at the end of the selected line from first file which is no longer
needed and therefore deleted. That stops also the selection mode and
moves the cursor to start of the next line. Of course the cursor is
always at top of the file after deleting a line. !*/
/*! This regex replace replaces all city names in the city column with the
original city names at start of the line to avoid changes in the city
names caused by different spelling of the city names in the first file. !*/
Find RegExp "%^(*|^)^(*|*|*|*|*|*|*|*|*|*|*|*|*|^)*|"
Replace All "|^2^1"
/*! All lines from the first file are processed and the special marker
line is deleted too. So now only the original lines of the second
file are present, but with the added websites. Clear user clipboard 9
to free RAM and switch back to the Windows clipboard. !*/
MonWeb wrote:É give us a problem, it doesn't want to do : Find MatchCase RegExp "[ÈÉÊË]" Replace All "E"