SHARE
TWEET

DeDup.exe Removes duplicate lines from StdIn and writes to S

dcandygmailcom Feb 21st, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM Two files follow
  2. REM DeDup.bat
  3. REM This file compiles DeDup.vb to DeDup.exe
  4. REM DeDup.exe Removes duplicate lines from StdIn and writes to StdOut
  5. REM To use
  6. REM DeDup  < inputfile.txt > outputfile.txt
  7. "C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc.exe" /target:exe /out:"%~dp0\DeDup.exe" "%~dp0\DeDup.vb" /verbose
  8. pause
  9.  
  10. -----------------------------------------------------
  11.  
  12. 'DeDup.vb
  13. Imports System
  14. Imports System.IO
  15. Imports System.Runtime.InteropServices
  16. Imports Microsoft.Win32
  17.  
  18. Public Module DeDup
  19. Sub Main
  20.     Dim Dict as Object
  21.     Dict = CreateObject("Scripting.Dictionary")
  22.     Dim Line As Object
  23.     Line=Console.readline
  24.     Do Until Line = Nothing
  25.         On Error Resume Next
  26.         Dict.Add(Line, "")
  27.         On Error Goto 0
  28.         Line=Console.readline
  29.     Loop
  30.     For Each thing in Dict.Keys()
  31.         Console.writeline(thing)
  32.     Next
  33. End Sub
  34. End Module
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top