LoneWolf_2106

String sorting - Date and time

18 posts in this topic

#1 ·  Posted

Hi everybody,

i have a question related to strings items in an Array and sorting. Maybe someone can advice me how to solve the issue.

I have an Array of strings, every item of the Array is as following:

  • INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection] 
  • INFO [07.06.2017 08:55:44] [main] MDU5 - Ver 5.1x

I want to sort the item in the array by date and time, is there any function which allows me to sort by date/time?

Thanks in advance

Share this post


Link to post
Share on other sites



#2 ·  Posted

Moved to appropriate forum


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

Basic example, although someone that is good with RegEx could write something better.

#include <Array.au3>
Local $aInfo[2] = ['INFO [07.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]', 'INFO [07.06.2017 08:55:44] [main] MDU5 - Ver 5.1x']
Local $aModified[UBound($aInfo)][2], $sDate
For $i = 0 To UBound($aInfo) - 1
    $sDate = StringMid($aInfo[$i], StringInStr($aInfo[$i], "INFO [") + StringLen("INFO ["), 19)
    $aModified[$i][0] = StringFormat("%04i/%02i/%02i", StringMid($sDate, 7, 4), StringMid($sDate, 4, 2), StringLeft($sDate, 2)) & StringRight($sDate, 9)
    $aModified[$i][1] = $aInfo[$i]
Next
_ArraySort($aModified, 0, 0, 0, 0)
_ArrayDisplay($aModified)

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

another way.

 

#include <Array.au3>
Local $aArray = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _
        "INFO [07.06.2017 08:55:44] [main] MDU5 - Ver 5.1x", _
        "INFO [07.06.2017 12:55:11] [main] Dummy String1", _
        "INFO [07.06.2016 09:55:11] [main] Dummy String2", _
        "INFO [07.06.2017 09:55:12] [main] Dummy String3", _
        "INFO [07.06.2017 09:55:11] [main] Dummy String4"]


_ArrayDisplay($aArray, "No sorted")
_Sort($aArray)
_ArrayDisplay($aArray, "Sorted")

Func _Sort(ByRef $aArray)
    For $i = UBound($aArray) - 1 To 1 Step -1
        For $j = 1 To $i
            If _GetNumber($aArray[$j - 1]) > _GetNumber($aArray[$j]) Then
                $temp = $aArray[$j - 1]
                $aArray[$j - 1] = $aArray[$j]
                $aArray[$j] = $temp
            EndIf
        Next
    Next
    Return $aArray
EndFunc   ;==>_Sort


Func _GetNumber($String)
    Return Number(StringRegExpReplace(StringMid($String, 7, 19), '(\d{2})\.(\d{2})\.(\d{4})', "$3$2$1")) ;mikell's regexp
EndFunc   ;==>_GetNumber

Saludos

Edited by Danyfirex

Share this post


Link to post
Share on other sites

#5 ·  Posted

So assuming you have that portion of the string, since that's been done twice now,  here is a way with datediff

#include <Date.au3>
#include<array.au3>

local $Arr[5]
$Arr[0] = "13.06.2017 11:48:01"
$Arr[1] = "07.06.2017 08:55:44"
$Arr[2] = "05.06.2017 08:55:40"
$Arr[3] = "12.06.2017 08:55:43"
$Arr[4] = "07.06.2017 08:55:42"

For $i = 0 to ubound($Arr) - 2

    If stringleft( _DateDiff("s" , stringmid($Arr[$i] , 7 , 4) & "/" & stringmid($Arr[$i] , 4 , 2) & "/" &  stringmid($Arr[$i] , 1 , 2) & " " & stringright($Arr[$i] , 8) , stringmid($Arr[$i + 1] , 7 , 4) & "/" & stringmid($Arr[$i + 1] , 4 , 2) & "/" &  stringmid($Arr[$i + 1] , 1 , 2) & " " & stringright($Arr[$i + 1] , 8)) , 1) = "-" Then
        _ArraySwap($Arr , $i , $i + 1)
        $i = -1
    EndIf

Next

_ArrayDisplay($Arr)

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#6 ·  Posted

And another way ... sooo classic   :)

#include <Array.au3>

Local $aArray[6] = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _
        "INFO [07.06.2018 08:55:44] [main] MDU5 - Ver 5.1x", _
        "INFO [07.06.2017 12:55:11] [main] Dummy String1", _
        "INFO [07.06.2016 09:55:11] [main] Dummy String2", _
        "INFO [07.06.2017 09:55:12] [main] Dummy String3", _
        "INFO [07.06.2017 09:55:11] [main] Dummy String4"]

_ArrayDisplay($aArray, "No sorted")
_Sort($aArray)
_ArrayDisplay($aArray, "Sorted")


Func _Sort(ByRef $aArray)
     _ArrayColInsert($aArray, 1)
    For $i = 0 To UBound($aArray) - 1
       $aArray[$i][1] = StringRegExpReplace($aArray[$i][0], '(\d{2})\.(\d{2})\.(\d{4})', "$3$2$1")
    Next
    _ArraySort($aArray, 0, 0, 0, 1)
    _ArrayColDelete($aArray, 1)
EndFunc   ;==>_Sort

 

2 people like this

Share this post


Link to post
Share on other sites

#7 ·  Posted

This solution worked greatly. Many thanks.

 

I didn't try yet the other solutions

 

 

On ‎23‎.‎06‎.‎2017 at 6:39 PM, Danyfirex said:

another way.

 

#include <Array.au3>
Local $aArray = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _
        "INFO [07.06.2017 08:55:44] [main] MDU5 - Ver 5.1x", _
        "INFO [07.06.2017 12:55:11] [main] Dummy String1", _
        "INFO [07.06.2016 09:55:11] [main] Dummy String2", _
        "INFO [07.06.2017 09:55:12] [main] Dummy String3", _
        "INFO [07.06.2017 09:55:11] [main] Dummy String4"]


_ArrayDisplay($aArray, "No sorted")
_Sort($aArray)
_ArrayDisplay($aArray, "Sorted")

Func _Sort(ByRef $aArray)
    For $i = UBound($aArray) - 1 To 1 Step -1
        For $j = 1 To $i
            If _GetNumber($aArray[$j - 1]) > _GetNumber($aArray[$j]) Then
                $temp = $aArray[$j - 1]
                $aArray[$j - 1] = $aArray[$j]
                $aArray[$j] = $temp
            EndIf
        Next
    Next
    Return $aArray
EndFunc   ;==>_Sort


Func _GetNumber($String)
    Return Number(StringRegExpReplace(StringMid($String, 7, 19), "\D", ""))
EndFunc   ;==>_GetNumber

Saludos

 

Share this post


Link to post
Share on other sites

#8 ·  Posted

LoneWolf_2106,
Danyfirex' code fails when tried with the array that I used in my script  ;)

 

1 person likes this

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

thank you mikell :-P Fixed first reply.

 

 

Saludos

Edited by Danyfirex

Share this post


Link to post
Share on other sites

#10 ·  Posted

Dany,
It still fails using my array (on 2017 parts)  :)

Share this post


Link to post
Share on other sites

#11 ·  Posted

lol. thank you again. I'll fix it later. 

 

Saludos

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Hi everybody,

 

yes, i have tried with a more complex file and i confirm that it is not working.

Sorry :(

Edited by LoneWolf_2106

Share this post


Link to post
Share on other sites

#13 ·  Posted

Can you post the more complex file?

Share this post


Link to post
Share on other sites

#14 ·  Posted

1 hour ago, Subz said:

Can you post the more complex file?

 

Unfortunately i cannot post my original file, because it contains many entries with sensitive data. Anyway there are several entries like the one i posted before. The log content is just bigger.

 

As for now i am using this solution and i will test it for a while:

 

On ‎23‎.‎06‎.‎2017 at 9:49 PM, mikell said:

And another way ... sooo classic   :)

#include <Array.au3>

Local $aArray[6] = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _
        "INFO [07.06.2018 08:55:44] [main] MDU5 - Ver 5.1x", _
        "INFO [07.06.2017 12:55:11] [main] Dummy String1", _
        "INFO [07.06.2016 09:55:11] [main] Dummy String2", _
        "INFO [07.06.2017 09:55:12] [main] Dummy String3", _
        "INFO [07.06.2017 09:55:11] [main] Dummy String4"]

_ArrayDisplay($aArray, "No sorted")
_Sort($aArray)
_ArrayDisplay($aArray, "Sorted")


Func _Sort(ByRef $aArray)
     _ArrayColInsert($aArray, 1)
    For $i = 0 To UBound($aArray) - 1
       $aArray[$i][1] = StringRegExpReplace($aArray[$i][0], '(\d{2})\.(\d{2})\.(\d{4})', "$3$2$1")
    Next
    _ArraySort($aArray, 0, 0, 0, 1)
    _ArrayColDelete($aArray, 1)
EndFunc   ;==>_Sort

 

 

I have just a problem, i have a monodimensional Array in Input and it is basically "converted" to bidimensional. How can i use the array? I mean, how can i access the array items?

 

Share this post


Link to post
Share on other sites

#15 ·  Posted

Basic example:

#include <Array.au3>

Global $aOneDimension[3] = [2, "Row1", "Row2"]
_ArrayDisplay($aOneDimension)
For $i = 1 To $aOneDimension[0]
    MsgBox(4096, "One Dimension Array", $aOneDimension[$i])
Next

Global $aTwoDimension[3][3] = [["Row0 Col0", "Row0 Col1", "Row0 Col2"],["Row1 Col0", "Row1 Col1", "Row1 Col2"], ["Row2 Col0", "Row2 Col1", "Row2 Col2"]]
_ArrayDisplay($aTwoDimension)
For $i = 0 To UBound($aTwoDimension) - 1
    MsgBox(4096, "Two Dimension Array", "Row" & $i & @CRLF & $aTwoDimension[$i][0] & @TAB & $aTwoDimension[$i][1] & @TAB & $aTwoDimension[$i][2])
Next

 

Share this post


Link to post
Share on other sites

#16 ·  Posted

Hello. Here is my script fixed.

 

#include <Array.au3>

Local $aArray[6] = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _
        "INFO [07.06.2018 08:55:44] [main] MDU5 - Ver 5.1x", _
        "INFO [07.06.2017 12:55:11] [main] Dummy String1", _
        "INFO [07.06.2016 09:55:11] [main] Dummy String2", _
        "INFO [07.06.2017 09:55:12] [main] Dummy String3", _
        "INFO [07.06.2017 09:55:11] [main] Dummy String4"]


_ArrayDisplay($aArray, "No sorted")
_Sort($aArray)
_ArrayDisplay($aArray, "Sorted")



Func _Sort(ByRef $aArray)
    For $i = UBound($aArray) - 1 To 1 Step -1
        For $j = 1 To $i
            If _GetNumber($aArray[$j - 1]) > _GetNumber($aArray[$j]) Then
                $temp = $aArray[$j - 1]
                $aArray[$j - 1] = $aArray[$j]
                $aArray[$j] = $temp
            EndIf
        Next
    Next
    Return $aArray
EndFunc   ;==>_Sort


Func _GetNumber($String)
    Local $iNumber=Number(StringRegExpReplace(StringRegExpReplace(StringMid($String, 7, 19), '(\d{2})\.(\d{2})\.(\d{4})', "$3$2$1"),"\D","")) ;mikell's regexp plus something
    Return $iNumber
EndFunc   ;==>_GetNumber

 

Saludos

Share this post


Link to post
Share on other sites

#17 ·  Posted

#include <Array.au3>
#include <Date.au3>

Local $aArray[6] = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _
"INFO [07.06.2018 08:55:44] [main] MDU5 - Ver 5.1x", _
"INFO [07.06.2017 12:55:11] [main] Dummy String1", _
"INFO [07.06.2016 09:55:11] [main] Dummy String2", _
"INFO [07.06.2017 09:55:12] [main] Dummy String3", _
"INFO [07.06.2017 09:55:11] [main] Dummy String4"]


For $i = 0 to ubound($aArray) - 2

    If stringleft( _DateDiff("s" , stringmid(StringRegExp($aArray[$i] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 7 , 4) & _
        "/" & stringmid(StringRegExp($aArray[$i] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 4 , 2) & _
        "/" & stringmid(StringRegExp($aArray[$i] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 1 , 2) & _
        " " & stringright(StringRegExp($aArray[$i] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 8) , stringmid(StringRegExp($aArray[$i + 1] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 7 , 4) & _
        "/" & stringmid(StringRegExp($aArray[$i + 1] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 4 , 2) & _
        "/" & stringmid(StringRegExp($aArray[$i + 1] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 1 , 2) & " " & stringright(StringRegExp($aArray[$i+1] , '(\d{2}\.\d{2}\.\d{4}.\d{2}:\d{2}:\d{2})' , 3)[0] , 8)) , 1) = "-" Then

            _ArraySwap($aArray , $i , $i + 1)
            $i = -1
    EndIf

Next

_ArrayDisplay($aArray)

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#18 ·  Posted

I have just written so:

 

For $i = 0 To UBound($searchResultArray) - 1
        FileWriteLine($hFileOpen, $searchResultArray[$i][0]  & @CRLF)
    Next

It looks working

Share this post


Link to post
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

  • Similar Content

    • Dimmae
      By Dimmae
      Hello,
      at first: i'm new here, so please forgive me my mistakes, and show them to me, just that i can learn to do better in the future.
      Now to my Problem: i have an excel sheet, where i just need some columns for further actions, but i have no idea how to add single columns to a new array.
      I found the following code(the one i just added as a file) from 'water' in this forum, but i wont get how i could add multiple columns into a new array.
      The biggest problem in my situation is that i dont know the count of the rows i need for the array, i just got a fix number of rows, which is 4.
       
      Hope you can help me, and sry again for this 'unlucky illustration'.
       
      btw: how can i add code shown as code here, instead of posting it as a attached file?.
       
       
       
      autoit-select-column.au3
      defects.xlsx
    • czardas
      By czardas
      Haven't had much time to code recently. However the following thread inspired me.
      The debate about linear, parallel and binary search methods was rather interesting and, in an attempt to be diplomatic, I decided to combine @jchd's suggestion with @LarsJ's binary search example. I decided that the binary search algorithm required modification to make it more linear. As usual, 'if you invent something, it probably already exists and if it already exists, it exists for a reason'. My first attempt was not all that good. The code worked but was really a mess. I blame peer pressure (to post an example of a parallel search method).  I will delete that old code in due course.
      With a little memory jogging and a glance at the help file, the solution turned out to be quite easy: I just needed a better understanding of Euler. Further modification will be needed to work with more complicated unicode strings. The output could be returned as an array or a delimitered string. I'm not so interested in those details. I'm just going to post the algorithm for now and anyone, who wants to, can modify it to suit their needs. Both arrays must contain at least 1 element.
      Local $aFoo = [0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,19,20,23,24,26,30,35,39,40,41] Local $aBar = [0,1,5,6,7,8,9,10,11,12,13,14,17,18,19,21,24,25,26,27,34,35,38,40] ParallelExponetialSearch($aFoo, $aBar) ; Compares two lists - returning positive matches. Each input array must be unique (individually) and in alphabetical order. Func ParallelExponetialSearch($aFoo, $aBar) Local $sFind, _ $iMin_F = -1, $iMax_F = UBound($aFoo) -1, $Lo_F = $iMin_F, $Hi_F, _ $iMin_B = -1, $iMax_B = UBound($aBar) -1, $Lo_B = $iMin_B, $Hi_B While $iMin_F < $iMax_F And $iMin_B < $iMax_B ; Toggle Arrays - Which array has most untested elements? This is the one we want to search next, ; so we can bypass more comparisons because (in theory) mismatches have a greater chance of being skipped. If $iMax_F - $iMin_F >= $iMax_B - $iMin_B Then ; $aFoo has more (or an equal number of) untested elements $Hi_F = $iMax_F $iMin_B += 1 $sFind = $aBar[$iMin_B] While $Lo_F < $Hi_F ; search $aFoo For $i = 0 To Floor(Log($Hi_F - $Lo_F) / Log(2)) $Lo_F = $iMin_F + 2^$i If $aFoo[$Lo_F] = $sFind Then $iMin_F = $Lo_F ; each match should be added to the output [perhaps an array] ConsoleWrite($sFind & " found at $aFoo[" & $Lo_F & "] = $aBar[" & $iMin_B & "]" & @LF) ExitLoop 2 ElseIf $aFoo[$Lo_F] > $sFind Then $Hi_F = $Lo_F -1 $iMin_F += Floor(2^($i -1)) $Lo_F = $iMin_F ContinueLoop 2 EndIf Next $iMin_F = $Lo_F ; minimum increment is one WEnd Else ; $aBar has more untested elements $Hi_B = $iMax_B $iMin_F += 1 $sFind = $aFoo[$iMin_F] While $Lo_B < $Hi_B ; search $aBar For $i = 0 To Floor(Log($Hi_B - $Lo_B) / Log(2)) $Lo_B = $iMin_B + 2^$i If $aBar[$Lo_B] = $sFind Then $iMin_B = $Lo_B ; each match should be added to the output [perhaps an array] ConsoleWrite($sFind & " found at $aFoo[" & $iMin_F & "] = $aBar[" & $Lo_B & "]" & @LF) ExitLoop 2 ElseIf $aBar[$Lo_B] > $sFind Then $Hi_B = $Lo_B -1 $iMin_B += Floor(2^($i -1)) $Lo_B = $iMin_B ContinueLoop 2 EndIf Next $iMin_B = $Lo_B ; minimum increment is one WEnd EndIf WEnd EndFunc ;==> ParallelExponetialSearch I hope this will be useful to someone. I believe it deserved a thread of its own!
    • cheeroke
      By cheeroke
      Hi all,
      I got this code and would like to be able to change Baud Rate and instead of sending character by character i would like to be able (if possible) to send whole string. But i don't know how to change it.
      I am taking input from file and processing whole line (this is done in FilesHandling.au3).
      To execute this i am just calling SendData("FileName", int) in "main" script.
      Any help very appreciated.
      #include <WinAPI.au3> #include <Array.au3> #include "FilesHandling.au3" ;init DLL function, we need handle to call the function $h = DllCall("Kernel32.dll", "hwnd", "CreateFile", "str", "\\.\COM19", "int", BitOR($GENERIC_READ,$GENERIC_WRITE), "int", 0, "ptr", 0, "int", $OPEN_EXISTING, "int", $FILE_ATTRIBUTE_NORMAL, "int", 0) $handle=$h[0] Func SendData($FileName, $LineNumber) ;string to be send $c = readFile($FileName, $LineNumber) $cLenght = StringLen($c) $aArray = StringSplit($c, "") ;_ArrayDisplay($aArray, "", Default, 64) For $i = 1 To $cLenght writeChar($handle, $aArray[$i], $cLenght) Next ;move to next line writeChar($handle, @CR,1) EndFunc ;write a single char func writeChar($handle,$c,) $stString = DLLStructCreate("char str") $lpNumberOfBytesWritten = 0 DllStructSetData($stString, 1, $c) $res = _WinAPI_WriteFile($handle, DllStructGetPtr($stString, "str"), 1,$lpNumberOfBytesWritten) if ($res<>true) then ConsoleWrite ( _WinAPI_GetLastErrorMessage() & @LF) EndIf EndFunc  
    • RC86
      By RC86
      Afternoon!
      I have a requirement to return both a string and an array from a function so as a result I put them both into an array and returned that.  I can access them in their entirety after returning them but then I can't seem to access the array elements after this.  Should I be able to or is there a prettier way?
      #include <Array.au3> ;Memory info returned as a string and an array $memoryInfo = _getMemoryInfo() msgbox(0,"Memory Info",$memoryInfo[0]) _ArrayDisplay($memoryInfo[1],"Memory as an Array") Local $newArray[7] $memoryInfo[1] = $newArray msgbox(0,"Test element",$newArray[0]) _ArrayDisplay($newArray) Func _getMemoryInfo() Local $newArray[7] Local $array = MemGetStats() $newArray[0] = $array[0] ;% of memory in use $newArray[1] = Round($array[1]/1024 * 0.001,2) ;Total physical RAM $newArray[2] = Round($array[2]/1024 * 0.001,2) ;Availaible physical RAM $newArray[3] = Round($array[3]/1024 * 0.001,2) ;Total pagefile $newArray[4] = Round($array[4]/1024 * 0.001,2) ;Available pagefile $newArray[5] = Round($array[5]/1024 * 0.001,2) ;Total virtual $newArray[6] = Round($array[6]/1024 * 0.001,2) ;Available virtual $memoryUsage = $newArray[1] - $newarray[2] $pagefileUsage = $newArray[3] - $newarray[4] ;Output/Return Local $returnArray[2] $returnArray[0] = "Memory: " & $memoryUsage & " GB/" & $newArray[1] & " GB " & @CRLF & "Pagefile: " & $pagefileUsage & " GB/" & $newArray[3] & " GB " $returnArray[1] = $newArray return $returnArray EndFunc A bit messy but hopefully it's understandable what I'm trying to achieve.
      Thanks!
    • FroVN
      By FroVN
      Hi, i have a problem :" can't set the name of file with a special character like: \;/;";|;...  have anyway to short the StringInSrt and Stringreplace? i am using this code but too long
      $title=InputBox(0,'','','')
         if StringInStr($title,'\') or StringInStr($title,'/') or StringInStr($title,':') or StringInStr($title,'*') or StringInStr($title,'?') or StringInStr($title,'"') or StringInStr($title,'<') or StringInStr($title,'>') or StringInStr($title,'|') Then
             $title=StringReplace($title,'\','-')
              $title=StringReplace($title,'/','-')
               $title=StringReplace($title,':','-')
                $title=StringReplace($title,'*','-')
                 $title=StringReplace($title,'?','-')
                  $title=StringReplace($title,'"','-')
                   $title=StringReplace($title,'<','-')
                    $title=StringReplace($title,'>','-')
                     $title=StringReplace($title,'|','-')
         EndIf