Jump to content

How Do I Not Be So Shellexecutish and Repititious?


Recommended Posts

Will do sir. Don't down yourself sir. If we don't mess up from time to time, how will we ever learn codemaster sir? BTW....I tried to send you a zip file of the files but AutoIT would'nt let me,sir.

Send me a PM with a valid Email address and I'll send you one where you can send me the files.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Send me a PM with a valid Email address and I'll send you one where you can send me the files.

Codemaster GeoSoft,

I've tried to merge these two script, although it cleared the compiler with no errors, the strings in title.txt aren't getting extracted and sent to D:\New Text Document (2).txt file.

#include<file.au3>
$sText = ""
$sPath = "D:\Documents and Settings\Taevon Jones\Desktop\Extracted Keywords\"
$aFiles = _FileListToArray($sPath, "*", 1)
If NOT @Error Then
    For $i = 1 To Ubound($aFiles) -1
        $sHold = FileRead($sPath & $aFiles[$i])
        $aTitle = StringRegExp($sHold, "(?i)<title>(.+)</title>", 1)
        If NOT @Error Then
            $sText &= $aTitle[0] & @CRLF
        EndIf
    Next
EndIf
If $sText Then
    $sFile = @TempDir & "\titles.txt"
    $hFile = FileOpen($sFile, 2)
    FileWrite($hFile, StringStripWS($sText, 2))
    FileClose($hFile)
    ShellExecute($sFile)
EndIf

Func _CreateTaggedKeywords()
    Dim $aRecords
    $PthFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt' ;Full path and filename to read
    $outputFileName = 'D:\New Text Document (2).txt'

    If Not _FileReadToArray($PthFile,$aRecords) Then
       MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
       Exit
    EndIf

    $file = FileOpen($outputFileName, 2)
    For $x = 1 to $aRecords[0]
        FileWriteLine($file,'<a href="'&$aRecords[$x]&'.htm">'&$aRecords[$x]&'</a><BR>'&@CRLF)

   Next


    FileClose($file)
EndFunc

I tried this but it didn't work.....

#include<file.au3>
$sText = ""
$sPath = "D:\Documents and Settings\Taevon Jones\Desktop\Extracted Keywords\"
$aFiles = _FileListToArray($sPath, "*", 1)
If NOT @Error Then
    For $i = 1 To Ubound($aFiles) -1
        $sHold = FileRead($sPath & $aFiles[$i])
        $aTitle = StringRegExp($sHold, "(?i)<title>(.+)</title>", 1)
        If NOT @Error Then
            $sText &= $aTitle[0] & @CRLF
        EndIf
    Next
EndIf
If $sText Then
    $sFile = @TempDir & "\titles.txt"
    $hFile = FileOpen($sFile, 2)
    FileWrite($hFile, StringStripWS($sText, 2))
    FileClose($hFile)
    ShellExecute($sFile)
EndIf

Func _CreateTaggedKeywords()
    Dim $aRecords
    $PthFile = @TempDir & 'titles.txt' ;Full path and filename to read
    $outputFileName = 'D:\New Text Document (2).txt'

    If Not _FileReadToArray($PthFile,$aRecords) Then
       MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
       Exit
    EndIf

    $file = FileOpen($outputFileName, 2)
    For $x = 1 to $aRecords[0]
        FileWriteLine($file,'<a href="'&$aRecords[$x]&'.htm">'&$aRecords[$x]&'</a><BR>'&@CRLF)

   Next


    FileClose($file)
EndFunc

What could I be doing wrong?

Link to comment
Share on other sites

One of your problems is probably related to the path structure.

Is "D:\Documents and Settings\Taevon Jones\Desktop" actually your Desktop folder?

If it is then change

$sPath = "D:\Documents and Settings\Taevon Jones\Desktop\Extracted Keywords\"

To

$sPath = @DeskTopDir & "\Extracted Keywords\"

Try to make use of Macros (in the help file) whenever possible. Also you may want to review some of the file names and perhaps use FileGetShortName() on them.

Now, it's Christmas eve and replies from me could be sporadic at best for the rest of the night and probably non-existant tomorrow.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

One of your problems is probably related to the path structure.

Is "D:\Documents and Settings\Taevon Jones\Desktop" actually your Desktop folder?

If it is then change

$sPath = "D:\Documents and Settings\Taevon Jones\Desktop\Extracted Keywords\"

To

$sPath = @DeskTopDir & "\Extracted Keywords\"

Try to make use of Macros (in the help file) whenever possible. Also you may want to review some of the file names and perhaps use FileGetShortName() on them.

Now, it's Christmas eve and replies from me could be sporadic at best for the rest of the night and probably non-existant tomorrow.

CodeMaster GEOSoft,

Yes, "D:\Documents and Settings\Taevon Jones\Desktop" is my Desktop folder. What are some of the benefits of Macros?

Link to comment
Share on other sites

Codemaster GeoSoft,

I found out what the problem was in mereging the two script. I was neglecting to place this _CreateTaggedKeywords()... before the second function as you can see below.

#include<file.au3>
$sText = ""
$sPath = @DeskTopDir & "\Extracted Keywords\"
$aFiles = _FileListToArray($sPath, "*", 1)
If NOT @Error Then
    For $i = 1 To Ubound($aFiles) -1
        $sHold = FileRead($sPath & $aFiles[$i])
        $aTitle = StringRegExp($sHold, "(?i)<title>(.+)</title>", 1)
        If NOT @Error Then
            $sText &= $aTitle[0] & @CRLF
        EndIf
    Next
EndIf
If $sText Then
    $sFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt'
    $hFile = FileOpen($sFile, 2)
    FileWrite($hFile, StringStripWS($sText, 2))
    FileClose($hFile)
    ShellExecute($sFile)

EndIf
_CreateTaggedKeywords()
Func _CreateTaggedKeywords()
    Dim $aRecords
    $PthFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt' ;Full path and filename to read
    $outputFileName = 'D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt'

    If Not _FileReadToArray($PthFile,$aRecords) Then
    MsgBox(4096,"Error", " Error reading log to Array   error:" & @error)
    Exit
    EndIf

    $file = FileOpen($outputFileName, 2)
    For $x = 1 to $aRecords[0]
        FileWriteLine($file,'<a href="'&$aRecords[$x]&'.htm">'&$aRecords[$x]&'</a><BR>'&@CRLF)

   Next


    FileClose($file)
EndFunc
Link to comment
Share on other sites

So all is well now?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

<br />So all is well now?<br />

<br /><br />Not exactly sir, their's still a final step thats been given me problems .  I believe, all I need is a StringReplace function(),  where I get confused is how to write the code to were the output of this script below..........<br /><br />
<br />
<br />
#include&lt;file.au3&gt;<br />
$sText = &quot;&quot;<br />
$sPath = @DeskTopDir &amp; &quot;\Extracted Keywords\&quot;<br />
$aFiles = _FileListToArray($sPath, &quot;*&quot;, 1)<br />
If NOT @Error Then<br />
&nbsp;&nbsp;&nbsp; For $i = 1 To Ubound($aFiles) -1<br />
    &nbsp;&nbsp;&nbsp; $sHold = FileRead($sPath &amp; $aFiles[$i])<br />
    &nbsp;&nbsp;&nbsp; $aTitle = StringRegExp($sHold, &quot;(?i)&lt;title&gt;(.+)&lt;/title&gt;&quot;, 1)<br />
    &nbsp;&nbsp;&nbsp; If NOT @Error Then<br />
        &nbsp;&nbsp;&nbsp; $sText &amp;= $aTitle[0] &amp; @CRLF<br />
    &nbsp;&nbsp;&nbsp; EndIf<br />
&nbsp;&nbsp;&nbsp; Next<br />
EndIf<br />
If $sText Then<br />
&nbsp;&nbsp;&nbsp; $sFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt'<br />
&nbsp;&nbsp;&nbsp; $hFile = FileOpen($sFile, 2)<br />
&nbsp;&nbsp;&nbsp; FileWrite($hFile, StringStripWS($sText, 2))<br />
&nbsp;&nbsp;&nbsp; FileClose($hFile)<br />
&nbsp;&nbsp;&nbsp; ShellExecute($sFile)<br />
<br />
EndIf<br />
_CreateTaggedKeywords()<br />
Func _CreateTaggedKeywords()<br />
&nbsp;&nbsp;&nbsp; Dim $aRecords<br />
&nbsp;&nbsp;&nbsp; $PthFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt' ;Full path and filename to read<br />
&nbsp;&nbsp;&nbsp; $outputFileName = 'D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt'<br />
<br />
&nbsp;&nbsp;&nbsp; If Not _FileReadToArray($PthFile,$aRecords) Then<br />
   &nbsp;&nbsp;&nbsp; MsgBox(4096,&quot;Error&quot;, &quot; Error reading log to Array &nbsp;&nbsp;&nbsp; error:&quot; &amp; @error)<br />
   &nbsp;&nbsp;&nbsp; Exit<br />
&nbsp;&nbsp;&nbsp; EndIf<br />
<br />
&nbsp;&nbsp;&nbsp; $file = FileOpen($outputFileName, 2)<br />
&nbsp;&nbsp;&nbsp; For $x = 1 to $aRecords[0]<br />
    &nbsp;&nbsp;&nbsp; FileWriteLine($file,'&lt;a href=&quot;'&amp;$aRecords[$x]&amp;'.htm&quot;&gt;'&amp;$aRecords[$x]&amp;'&lt;/a&gt;&lt;BR&gt;'&amp;@CRLF)<br />
<br />
   Next<br />
<br />
<br />
&nbsp;&nbsp;&nbsp; FileClose($file)<br />
EndFunc<br />
<br />
<br />
<br /><br />

........which is 'D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt'<br />,gets opened;extracted and placed at a certain place within each html file. Below is script that I've been fiddling with  that I hope does the trick........How can I change things to make $hFile = FileOpen(&quot;D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\index.htm&quot;,0)  not only go into index.htm but index1.htm,index2.htm etc,etc.

<br /><br /><br />
<br />
<br />
#include &lt;file.au3&gt;<br />
Global $hFile<br />
Global $SomeTxt<br />
Global $StartPos, $EndPos<br />
Global $Find_This, $Find_This_Too<br />
Global $MyResult<br />
<br />
$Find_This = &quot;&lt;GROUPLINKS&gt;&quot;<br />
$Find_This_Too = &quot;&lt;/GROUPLINKS&gt;&quot;<br />
$hFile = FileOpen(&quot;D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\index.htm&quot;,0)&nbsp;&nbsp;&nbsp; ;Open file in read mode<br />
<br />
If @error Then<br />
&nbsp;&nbsp;&nbsp; MsgBox(0,&quot;Warning&quot;, &quot;Unable to open file&quot;)<br />
&nbsp;&nbsp;&nbsp; Exit<br />
EndIf<br />
<br />
$SomeTxt = FileRead($hFile)&nbsp;&nbsp;&nbsp; ;reads the complete file<br />
FileClose($hFile)<br />
$StartPos = StringInStr($SomeTxt,$Find_This) + StringLen($Find_This) ;finds the first string and puts the pos direct behind the found string<br />
<br />
If $StartPos = 0 Then    &nbsp;&nbsp;&nbsp; ;means $Find_This not found, no need to continue<br />
&nbsp;&nbsp;&nbsp; MsgBox(0,&quot;Warning&quot;, &quot;Unable to find: &quot; &amp; $StartPos)<br />
&nbsp;&nbsp;&nbsp; Exit<br />
Else<br />
&nbsp;&nbsp;&nbsp; ConsoleWrite(&quot;$StartPos= &quot; &amp; $StartPos &amp; @CRLF)    &nbsp;&nbsp;&nbsp; ;not needed just added to check if code works<br />
EndIf<br />
<br />
$EndPos = StringInStr($SomeTxt,$Find_This_Too,0,1,$StartPos) ;finds the first occurence of $Find_This_Too after $Start_pos<br />
<br />
If $EndPos = 0 Then    &nbsp;&nbsp;&nbsp; ;means $Find_This_Too was not found, no need to continue<br />
&nbsp;&nbsp;&nbsp; MsgBox(0,&quot;Warning&quot;, &quot;Unable to find: &quot; &amp; $EndPos)<br />
&nbsp;&nbsp;&nbsp; Exit<br />
Else<br />
&nbsp;&nbsp;&nbsp; ConsoleWrite(&quot;$EndPos= &quot; &amp; $EndPos &amp; @CRLF)    &nbsp;&nbsp;&nbsp; ;not needed just added to check if code works<br />
EndIf<br />
<br />
$MyResult = (StringMid($SomeTxt,$StartPos,$EndPos-$StartPos))<br />
$MyResult = StringStripWS($MyResult,3)<br />
<br />
<br />
If StringLen($MyResult) &lt;&gt; 0 Then<br />
&nbsp;&nbsp;&nbsp; MsgBox(0,&quot;Finished&quot;, &quot;You were looking for: &quot; &amp; $MyResult&nbsp;&nbsp;&nbsp; )<br />
&nbsp;&nbsp;&nbsp; $text_from_clip = ClipGet()&nbsp;&nbsp;&nbsp; ;Takes the result off the clipboard<br />
&nbsp;&nbsp;&nbsp; $result = StringReplace($SomeTxt, $MyResult, $text_from_clip)<br />
&nbsp;&nbsp;&nbsp; Clipput($Result)&nbsp;&nbsp;&nbsp; ;Put the result on the clipboard<br />
Else<br />
&nbsp;&nbsp;&nbsp; MsgBox(0,&quot;Warning&quot;, &quot;Unable to find the wanted string&quot;)<br />
EndIf<br />
<br />
<br /><br />.... since I last emailed you the htm files, I've added an additional tag within all of them. Called the &quot;&lt;GROUPLINKS&gt; &quot;&lt;/GROUPLINKS&gt;&quot;  tags.  I'm trying to extract  send all in 'D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt'<br />to each htm file and insert the string betweet the  &lt;GROUPLINKS&gt; &lt;/GROUPLINKS&gt;tags. Edited by styles3000
Link to comment
Share on other sites

<br />&lt;br /&gt;&lt;br /&gt;Not exactly sir, their's still a final step thats been given me problems .  I believe, all I need is a StringReplace function(),  where I get confused is how to write the code to were the output of this script below..........&lt;br /&gt;&lt;br /&gt;

<br />
<br />
<br />
<br />
#include&amp;lt;file.au3&amp;gt;<br />
<br />
$sText = &amp;quot;&amp;quot;<br />
<br />
$sPath = @DeskTopDir &amp;amp; &amp;quot;\Extracted Keywords\&amp;quot;<br />
<br />
$aFiles = _FileListToArray($sPath, &amp;quot;*&amp;quot;, 1)<br />
<br />
If NOT @Error Then<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; For $i = 1 To Ubound($aFiles) -1<br />
<br />
    &amp;nbsp;&amp;nbsp;&amp;nbsp; $sHold = FileRead($sPath &amp;amp; $aFiles[$i])<br />
<br />
    &amp;nbsp;&amp;nbsp;&amp;nbsp; $aTitle = StringRegExp($sHold, &amp;quot;(?i)&amp;lt;title&amp;gt;(.+)&amp;lt;/title&amp;gt;&amp;quot;, 1)<br />
<br />
    &amp;nbsp;&amp;nbsp;&amp;nbsp; If NOT @Error Then<br />
<br />
        &amp;nbsp;&amp;nbsp;&amp;nbsp; $sText &amp;amp;= $aTitle[0] &amp;amp; @CRLF<br />
<br />
    &amp;nbsp;&amp;nbsp;&amp;nbsp; EndIf<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next<br />
<br />
EndIf<br />
<br />
If $sText Then<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $sFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt'<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $hFile = FileOpen($sFile, 2)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; FileWrite($hFile, StringStripWS($sText, 2))<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; FileClose($hFile)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; ShellExecute($sFile)<br />
<br />
<br />
<br />
EndIf<br />
<br />
_CreateTaggedKeywords()<br />
<br />
Func _CreateTaggedKeywords()<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim $aRecords<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $PthFile = 'D:\Documents and Settings\Taevon Jones\Desktop\titles.txt' ;Full path and filename to read<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $outputFileName = 'D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt'<br />
<br />
<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not _FileReadToArray($PthFile,$aRecords) Then<br />
<br />
   &amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(4096,&amp;quot;Error&amp;quot;, &amp;quot; Error reading log to Array &amp;nbsp;&amp;nbsp;&amp;nbsp; error:&amp;quot; &amp;amp; @error)<br />
<br />
   &amp;nbsp;&amp;nbsp;&amp;nbsp; Exit<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; EndIf<br />
<br />
<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $file = FileOpen($outputFileName, 2)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; For $x = 1 to $aRecords[0]<br />
<br />
    &amp;nbsp;&amp;nbsp;&amp;nbsp; FileWriteLine($file,'&amp;lt;a href=&amp;quot;'&amp;amp;$aRecords[$x]&amp;amp;'.htm&amp;quot;&amp;gt;'&amp;amp;$aRecords[$x]&amp;amp;'&amp;lt;/a&amp;gt;&amp;lt;BR&amp;gt;'&amp;amp;@CRLF)<br />
<br />
<br />
<br />
   Next<br />
<br />
<br />
<br />
<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; FileClose($file)<br />
<br />
EndFunc<br />
<br />
<br />
<br />
<br />
<br />
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
<br />
<br />
<br />
<br />
#include &amp;lt;file.au3&amp;gt;<br />
<br />
Global $hFile<br />
<br />
Global $SomeTxt<br />
<br />
Global $StartPos, $EndPos<br />
<br />
Global $Find_This, $Find_This_Too<br />
<br />
Global $MyResult<br />
<br />
<br />
<br />
$Find_This = &amp;quot;&amp;lt;GROUPLINKS&amp;gt;&amp;quot;<br />
<br />
$Find_This_Too = &amp;quot;&amp;lt;/GROUPLINKS&amp;gt;&amp;quot;<br />
<br />
$hFile = FileOpen(&amp;quot;D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\index.htm&amp;quot;,0)&amp;nbsp;&amp;nbsp;&amp;nbsp; ;Open file in read mode<br />
<br />
<br />
<br />
If @error Then<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(0,&amp;quot;Warning&amp;quot;, &amp;quot;Unable to open file&amp;quot;)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit<br />
<br />
EndIf<br />
<br />
<br />
<br />
$SomeTxt = FileRead($hFile)&amp;nbsp;&amp;nbsp;&amp;nbsp; ;reads the complete file<br />
<br />
FileClose($hFile)<br />
<br />
$StartPos = StringInStr($SomeTxt,$Find_This) + StringLen($Find_This) ;finds the first string and puts the pos direct behind the found string<br />
<br />
<br />
<br />
If $StartPos = 0 Then    &amp;nbsp;&amp;nbsp;&amp;nbsp; ;means $Find_This not found, no need to continue<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(0,&amp;quot;Warning&amp;quot;, &amp;quot;Unable to find: &amp;quot; &amp;amp; $StartPos)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit<br />
<br />
Else<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; ConsoleWrite(&amp;quot;$StartPos= &amp;quot; &amp;amp; $StartPos &amp;amp; @CRLF)    &amp;nbsp;&amp;nbsp;&amp;nbsp; ;not needed just added to check if code works<br />
<br />
EndIf<br />
<br />
<br />
<br />
$EndPos = StringInStr($SomeTxt,$Find_This_Too,0,1,$StartPos) ;finds the first occurence of $Find_This_Too after $Start_pos<br />
<br />
<br />
<br />
If $EndPos = 0 Then    &amp;nbsp;&amp;nbsp;&amp;nbsp; ;means $Find_This_Too was not found, no need to continue<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(0,&amp;quot;Warning&amp;quot;, &amp;quot;Unable to find: &amp;quot; &amp;amp; $EndPos)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit<br />
<br />
Else<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; ConsoleWrite(&amp;quot;$EndPos= &amp;quot; &amp;amp; $EndPos &amp;amp; @CRLF)    &amp;nbsp;&amp;nbsp;&amp;nbsp; ;not needed just added to check if code works<br />
<br />
EndIf<br />
<br />
<br />
<br />
$MyResult = (StringMid($SomeTxt,$StartPos,$EndPos-$StartPos))<br />
<br />
$MyResult = StringStripWS($MyResult,3)<br />
<br />
<br />
<br />
<br />
<br />
If StringLen($MyResult) &amp;lt;&amp;gt; 0 Then<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(0,&amp;quot;Finished&amp;quot;, &amp;quot;You were looking for: &amp;quot; &amp;amp; $MyResult&amp;nbsp;&amp;nbsp;&amp;nbsp; )<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $text_from_clip = ClipGet()&amp;nbsp;&amp;nbsp;&amp;nbsp; ;Takes the result off the clipboard<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = StringReplace($SomeTxt, $MyResult, $text_from_clip)<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; Clipput($Result)&amp;nbsp;&amp;nbsp;&amp;nbsp; ;Put the result on the clipboard<br />
<br />
Else<br />
<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(0,&amp;quot;Warning&amp;quot;, &amp;quot;Unable to find the wanted string&amp;quot;)<br />
<br />
EndIf<br />
<br />
<br />
<br />
&lt;br /&gt;&lt;br /&gt;.... since I last emailed you the htm files, I've added an additional tag within all of them. Called the &amp;quot;&amp;lt;GROUPLINKS&amp;gt; &amp;quot;&amp;lt;/GROUPLINKS&amp;gt;&amp;quot;  tags.  I'm trying to extract  send all in 'D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt'&lt;br /&gt;to each htm file and insert the string betweet the  &amp;lt;GROUPLINKS&amp;gt; &amp;lt;/GROUPLINKS&amp;gt;tags.<br />
<br /><br /><br />

I don't know what just happened to my post, could anybody tell me why it has all the funny characters in it?

Link to comment
Share on other sites

Send me a PM with a valid Email address and I'll send you one where you can send me the files.

Codemaster GEOSoft',

All is well, I pulled some code together that suited my needs. Thank you again as well as everyone elses support.

Edited by styles3000
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...