Loading ...
Sorry, an error occurred while loading the content.

[Clip] Re: Automatized renaming depending on an html tag

Expand Messages
  • Larry Thomas
    Hi BONG, ... I suggest that you have all of the documents you want renamed in special directory for that purpose. You can then have a clip open them all for
    Message 1 of 2 , Jul 10, 1999
    • 0 Attachment
      Hi BONG,

      At 03:40 PM 7/10/1999 +0300, you wrote:
      >I'll try to explain the tricky problem I want to solve.
      >I have about 300 .html files with information about countries. The name of
      >each country is in the head tag of the appropriate document, eg
      ><HEAD><title>Aruba</title></HEAD>.
      >The problem is that the filenames of all the 300 documents are completely
      >undescriptive: aa.html, ac.html, af.html and so on. And here's what I'm
      >asking: is there a clip or any other tool/way to make the name of each
      >country go from a specified place in a document to the filename? Like this:
      >the document with the word "Aruba" in the head tag would be renamed to
      >aruba.html
      >
      >I know it's hard to imagine a solution to this problem... :-/

      I suggest that you have all of the documents you want renamed in special
      directory for that purpose. You can then have a clip open them all for
      renaming.

      Here is the way the clip might work:

      ---------< start clip >---------
      H="Rename Files"
      ^!Keyboard Alt+A C N #AAA# Enter
      ;Creates a temporary Favorites category named "AAA"

      ^!Keyboard Alt+A O A
      ;Adds all of your currently open files to the new category
      ;WARNING: This does not add unsaved documents you are working on to
      favorites. You risk losing those with the next command.

      ^!Close All
      ;Closes all of your open documents before loading the files to be renamed

      ^!Open Pathname\HtmDir\*htm
      ;Opens all of the files to be renamed

      ^!SetDocIndex 1
      ;Places the focus on the first index item or document tab to be processed

      :Loop
      ;The beginning of the renaming loop

      ^!Jump Doc_Start
      ;Ensures that you are on the first line of each document to be processed
      ;See note below if your tags are anywhere else but the first line (if so
      you must change this command)

      ^!Select Line
      ;This selects/hilights the line with the tags in it and keeps the following
      command
      ;from affecting or changing other lines

      ^!Keyboard Shift+Ctrl+T Ctrl+C Ctrl+Z
      ;Strips the tags, copies the country name to the clipboard, executes an
      Undo to restore the Html tags

      ^!RenameDoc ^$Getclipboard$.htm
      ;Uses the country name now in the clipboard to rename the document.

      ^!Keyboard Ctrl+Tab
      ;Switches to the next document/Tab

      ^!If ^$GetDocIndex$ = 1 Next Else Loop
      ;When the last document is reached Ctrl+Tab will rotate to the start of the
      open
      ;document index which will cause this loop to end

      ^!Close All
      ;Closes all of the renamed files

      ^!Keyboard Alt+A C A A
      ;Re-opens the previously closed files from the new Favorites category.

      ^!Keyboard Alt+A C D
      ;Deletes the AAA category created by this clip
      ---------< end clip >-----------

      Change Pathname\HtmDir\ to what ever directory/folder your files are in.
      Change ^!Jump Doc_Start to ^!Jump 2 or 3 or what ever line your header tag
      is on. If the tag is not on a fixed line or if it is mixed in a line with
      other things, this clip will have to be re-written to find it. Let me know
      and I will see what I can do.

      As with so many things, I can guarantee nothing. I have NOT tested this
      (only bits and pieces of it) and it is at your own risk although I believe
      that it should work.

      Good luck,

      Larry
      larryt@...

      ------------------------------------------------------------------------

      eGroups.com home: http://www.egroups.com/group/ntb-clips
      http://www.egroups.com - Simplifying group communications
    • Jody
      Hi All, ... I put the above Clip in the larger post. somebody had originally wrote it and I only made minor adjustments to it. It may have been Charles.
      Message 2 of 2 , Jul 10, 1999
      • 0 Attachment
        Hi All,

        >H="Switch2Doc#"
        >^!SetHintInfo Getting names and numbers...
        >^!Set %num%=0; %nDex%=0; %docs%=^%Empty%

        I put the above Clip in the larger post. somebody had originally
        wrote it and I only made minor adjustments to it. It may have
        been Charles. Would the person please let us know so I can put
        in the Clip who it was by? TIA (It is not the original name of
        the Clip.)

        Happy NoteTabbin',
        Jody Adair

        The NoteTabbers Assistant Page
        http://www.sureword.com/notetab
        NoteTab Home Page - Go Pro.....
        http://www.notetab.com

        ------------------------------------------------------------------------

        eGroups.com home: http://www.egroups.com/group/ntb-clips
        http://www.egroups.com - Simplifying group communications
      Your message has been successfully submitted and would be delivered to recipients shortly.