Guest User

Untitled

a guest
Jun 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #NoTrayIcon
  2.  
  3. #include <Array.au3>
  4.  
  5. $fileCSV = @ScriptDir & "\test.csv"
  6.  
  7. $fileCSVinArray = FileReadToArray($fileCSV)
  8. $fileCSVinString = _ArrayToString($fileCSVinArray, @CRLF)
  9. $fileCSVinString = StringStripWS($fileCSVinString, 4) ;remove double (or more) spaces between words
  10.  
  11. #cs
  12.  
  13. List of dangerous characters and their safe alternatives:
  14.  
  15. ' ' => '%20', '!' => '%21', '"' => '%22',
  16. '#' => '%23', '$' => '%24', '%' => '%25',
  17. '&' => '%26', '\'' => '%27', '(' => '%28',
  18. ')' => '%29', '*' => '%2A', '+' => '%2B',
  19. ',' => '%2C', '-' => '%2D', '.' => '%2E',
  20. '/' => '%2F', ':' => '%3A', ';' => '%3B',
  21. '<' => '%3C', '=' => '%3D', '>' => '%3E',
  22. '?' => '%3F', '@' => '%40', '[' => '%5B',
  23. '\\' => '%5C', ']' => '%5D', '^' => '%5E',
  24. '_' => '%5F', '`' => '%60', '{' => '%7B',
  25. '|' => '%7C', '}' => '%7D', '~' => '%7E',
  26.  
  27. #ce
  28.  
  29. Local $fromTo[9][2] = [["""", ""] _
  30. , [@TAB, ""] _
  31. , ["; ", ";"] _
  32. , [" ;", ";"] _
  33. , [" ", "%20"] _
  34. , ["/", "%2F"] _
  35. , ["\", "%27"] _
  36. , ["+", "%2B"] _
  37. , ["-", "%2D"]]
  38.  
  39. For $i = 0 to UBound($fromTo, 1) - 1 ;rows
  40. For $j = 0 to UBound($fromTo, 2) - 1 ;columns
  41. $fileCSVinString = StringReplace($fileCSVinString, $fromTo[$i][0], $fromTo[$i][1])
  42. Next
  43. Next
  44.  
  45. ClipPut($fileCSVinString) ;or FileWrite...
Add Comment
Please, Sign In to add comment