Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #181399

Re: How to edit HTML source file on Windows in one step (not two)?

From Marion <marion@facts.com>
Newsgroups alt.comp.os.windows-10, alt.comp.software.firefox, comp.editors
Subject Re: How to edit HTML source file on Windows in one step (not two)?
Date 2025-01-16 02:16 +0000
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <vm9q5k$lu$1@nnrp.usenet.blueworldhosting.com> (permalink)
References (1 earlier) <vm8f86$2vlvs$1@dont-email.me> <vm8tks$1d1j$1@nnrp.usenet.blueworldhosting.com> <vm8vur$32j3l$1@dont-email.me> <vm949l$ee7$1@nnrp.usenet.blueworldhosting.com> <vm97jb$342th$1@dont-email.me>

Cross-posted to 3 groups.

Show all headers | View raw


On Wed, 15 Jan 2025 16:00:08 -0500, Newyana2 wrote :


>> I have about a dozen of those Notepad++ macros which convert non-printable
>> (or inconsistent) characters to printable (or to consistent) characters 
>> after I've cut and pasted from an HTML page.
>> 
>     Sorry, but I lost you. You're assuming people know that
> macro code and how it works.

Oh. I apologize. Allow me to briefly explain what Notepad++ does well.

Here's the problem that we're trying to solve with that shortcuts.xml file.
1. Let's say you copied and pasted from, oh, say five different web sites.
2. Lot's of "strange" & "inconsistent" characters will have been pasted.
3. Pasting the results into Notepad++ & running the macro cleans it all up.

Some of the crazy things that get pasted from web to text are...
a. If there are inconsistent styles of quotes, the macro fixes all that.
b. If there are special characters (e.g., umlauts), the macro fixes that. 
c. If there are unprintable characters, the macro fixes that too.
Each time you run into something strange, you add a new macro to fix it.
That way you never have to repeat the same effort ever again.

You just make the macro longer and longer every time you find a problem.

All you do to fix *any* set of characters from web page cut and pastes is
 A. Win+R > n (this starts Notepad++)
 B. Control+V (this pastes your web copies into Notepad++)
 C. Control+A (this selects all the text that was copied to Notepad++)
 D. Control+B (this runs the shortcuts.xml macro on the selected set

In that quick sequence, you can clean up pastes of multiple web pages where
all sorts of hidden characters, strange characters & inconsistently
punctuation can be fixed. 

A simple example is some web pages use "curly quotes" (sometimes called
"smart quotes") and some web pages don't use those fancy quotes - but you
want your final result to be consistent so you fix it to the same type.

Another example are bullet items. Another example is hidden text that the
web page insert for trademarks. Another example are strange characters such
as the "ae" character or the long "--" character (there are many of these).

The Notepad++ single-step macro cleans it all up in a single step.
What could be better than that?

>> Well, how do you convert this template set into something useful?
>> <A HREF=https://www.amazon.com/s?k=foo+bar>amazon foo bar</A><P> <A 
>> HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>vine foo 
>> bar</A>
>> 
>> If I want to convert that template to, oh, say, "laptop computer", I run:
>> ma������������������������ ===> mark a
>> mb������������������������ ===> mark b
>> <esc>:'a,'bs/foo/laptop/g� ===> from a to b globally replace foo with 
>> laptop <esc>:'a,'bs/bar/pc/g� ===> from a to b globally replace bar with pc
>> 
> 
>     Again, you lost me. I don't see a template. Weren't
> we talking about editing HTML?

My apologies. The TEMPLATE is the two lines inside of the text file.
Those two lines are placeholder lines. They're the template.
So the HTML template is teh two lines above, one for Amazon, one for Vine.

When you want to add an item, you munge those two lines without destroying
them, so you first make a copy of those two lines with "mark a" and then
you drop down two lines and "yank to a" and then "paste" what you yanked. 

In gvim, that sequence is "ma" & "jj" & y'a" and then "p".
a. ma => mark a
b. jj => drop down two lines
c. y'a => yank to a
d. p => paste the result

At that point, you have FOUR lines. Two for the original HEML template.
And two for the copy of that original template set of HTML lines.

At that point, you munge the SECOND SET of lines to the links you want.

FROM:
 <A HREF=https://amazon.com/s?k=foo+bar>amazon foo bar</A><P> 
 <A HREF=https://amazon.com/vine/vine-items?search=foo%20bar>vine foo bar</A>
TO:
 <A HREF=https://amazon.com/s?k=laptop+pc>amazon laptop pc</A><P> 
 <A HREF=https://amazon.com/vine/vine-items?search=laptop%20pc>vine laptop pc</A>

Now you have clickable links to run the desired searches.

In short, you did the following:
a. You created a two-line template
b. Then you copied that template & used regular expressions on the copy
c. The result is two lines that did something you wanted to be a link

>> <A HREF=https://www.amazon.com/s?k=foo+bar>amazon foo bar</A><P> <A 
>> HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>vine foo 
>> bar</A>

> 
>> What I'd REALLY WANT is the ability to add items to the bookmarks file.
>> 
>      Yes. That seems to be the confusion. You're not looking to
> edit HTML. You're looking to autmoate specific text editing

Yeah. I think most people would like a bm.bat file which just asked for
what URL they wanted to go to and what they wanted to call it.

 C:\> bm.bat
      What is the URL please?
      What do you want to call it?

 If you gave it the following two answers, it would add to the bm.htm file:
      What is the URL please?
       https://www.midomi.com/

      What do you want to call it?   
       hum songs to find them

The resulting bookmarks.html file would have a new line of the following:
 <A HREF=https://www.midomi.com/>hum songs to find them</A><P>
 
> I use VBScript for things like that. BAT files are limited. I
> actually keep a lot of VBS files on my Desktop, to do things
> like  Copy folderA to folderB if files in folderA do not exist in
> folderB. Decode base64. Convert unix returns to Windows
> returns. Convert a returnlss CSS block to clear lines with
> returns. Clean all temp folders. Convert an encoded URL to
> a clean one by doing things like replacing %3A%2F%2F to
> ://. Collect all domains referenced in an HTML file and present
> them in a window with an option to add them to HOSTS. Etc.
> 
>    All of that is fairly simple with VBScript of javascript files running
> under Windows Script Host. (And of course, a specialized editor for
> VBS is also handy. :)

I don't disagree but I never learned VBS. 
So for me it would have to be a batch file doing the following, which I
think billions of Windows users would be able to use because they need it.

bm.bat
 Q: What is the URL?
 Q: What do you want to call it?

If you enter in for the URL, oh, say:
 "https://ispdesign.ui.com/"
And if you enter in what to call it of, oh, say:
 "design antenna"

Then the resulting bookmarks file should have this added line to it:
 <A HREF=https://ispdesign.ui.com/>design antenna</A><P>

Wouldn't almost everyone in the world want that bm.bat to create a single
system-wide custom bookmarks file that is browser independent?

Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-15 09:20 +0000
  Re: How to edit HTML source file on Windows in one step (not two)? Herbert Kleebauer <klee@unibwm.de> - 2025-01-15 11:42 +0100
    Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-15 11:28 +0000
      Re: How to edit HTML source file on Windows in one step (not two)? "R.Wieser" <address@is.invalid> - 2025-01-15 13:35 +0100
        Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-15 18:10 +0000
          Re: How to edit HTML source file on Windows in one step (not two)? "R.Wieser" <address@is.invalid> - 2025-01-15 22:15 +0100
            Re: How to edit HTML source file on Windows in one step (not two)? "R.Wieser" <address@is.invalid> - 2025-01-16 14:29 +0100
      Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-15 13:36 +0100
        Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-15 18:10 +0000
          Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-16 23:08 +0100
            Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-17 04:28 +0000
              Re: How to edit HTML source file on Windows in one step (not two)? Herbert Kleebauer <klee@unibwm.de> - 2025-01-17 10:03 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-17 18:37 +0000
              Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-18 14:33 +0100
  Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-15 09:04 -0500
    Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-15 18:09 +0000
      Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-15 13:49 -0500
        Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-15 20:03 +0000
          Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-15 16:00 -0500
            Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-16 02:16 +0000
        Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-18 06:47 +0000
          Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-18 09:09 -0500
            Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-18 15:25 +0100
              Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-18 13:55 -0500
                Re: How to edit HTML source file on Windows in one step (not two)? gazelle@shell.xmission.com (Kenny McCormack) - 2025-01-18 20:15 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-18 21:19 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-18 20:55 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-18 23:29 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-19 00:44 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-19 03:50 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-19 03:56 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-19 09:43 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-19 14:16 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-19 21:27 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Eric Pozharski <apple.universe@posteo.net> - 2025-01-22 17:57 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-19 08:18 -0500
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-20 01:13 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-20 01:15 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-20 14:00 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-21 04:48 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-21 13:28 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-21 08:39 -0500
                Re: How to edit HTML source file on Windows in one step (not two)? Frank Slootweg <this@ddress.is.invalid> - 2025-01-21 14:00 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-22 00:09 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-18 16:56 -0500
                Re: How to edit HTML source file on Windows in one step (not two)? gazelle@shell.xmission.com (Kenny McCormack) - 2025-01-18 21:57 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-18 17:40 -0500
                Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-18 23:33 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-18 20:54 +0000
            Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-18 20:50 +0000
              Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-18 17:36 -0500
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-19 00:46 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-19 10:00 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-19 21:16 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-20 03:04 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-20 09:26 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-21 04:47 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-21 07:41 +0100
                Re: How to edit HTML source file on Windows in one step (not two)? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-22 00:11 +0000
                Re: How to edit HTML source file on Windows in one step (not two)? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-22 11:48 +0100
                Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) gazelle@shell.xmission.com (Kenny McCormack) - 2025-01-22 13:13 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-22 19:54 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-22 22:25 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-23 04:29 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Newyana2 <newyana@invalid.nospam> - 2025-01-23 08:20 -0500
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-23 21:02 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-23 22:18 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Frank Miller <miller@posteo.ee> - 2025-01-24 00:25 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-23 23:35 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-23 23:48 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-24 00:48 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-24 11:30 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Frank Miller <miller@posteo.ee> - 2025-01-24 00:49 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-24 10:40 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-24 18:03 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Marion <marion@facts.com> - 2025-01-24 18:14 +0000
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-25 14:22 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) "Carlos E.R." <robin_listas@es.invalid> - 2025-01-25 14:39 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-25 17:48 +0100
                Re: Strange questions (Was: How to edit HTML source file on Windows in one step (not two)?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-23 23:46 +0000
    Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-16 15:05 +0100
      Re: How to edit HTML source file on Windows in one step (not two)? Newyana2 <newyana@invalid.nospam> - 2025-01-16 11:08 -0500
        Re: How to edit HTML source file on Windows in one step (not two)? "Carlos E.R." <robin_listas@es.invalid> - 2025-01-16 23:03 +0100
  Re: How to edit HTML source file on Windows in one step (not two)? Marion <marion@facts.com> - 2025-01-24 01:07 +0000

csiph-web