Network Engineer -- A Looking Glass

A look into my work as a Network Engineer

Friday, April 10, 2015

Parse File, Write to a Different File


Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\test2.txt", ForReading)

Set objWrite = objFSO.OpenTextFile("C:\Scripts\output.txt", 2)

Dim arrFileLines()

i = 0

Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop

objFile.Close

For Each strLine in arrFileLines
MyArray = Split(strLine, ".", -1, 1)
Msg = MyArray(0)
Msgbox Msg

objWrite.WriteLine("<a href=""https://comp.service-now.com/GOTO=" & Msg & Chr(34) & ">" _
& Msg & "</a>" & "</p>" & vbCrLf)

' objWrite.WriteLine("=HYPERLINK(""https://comp.service-now.com/GOTO=" & Msg _
' & Chr(34) & "" & ",""Click Here"")")

' objWrite.WriteLine("https://comp.service-now.com/GOTO=" & Msg)

Next
Posted by Scot Geer at 8:52 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Favorite Blogs

  • I ♥ WiFi
  • Network Fun!!!

Blog Archive

  • ►  2016 (2)
    • ►  August (1)
    • ►  February (1)
  • ▼  2015 (8)
    • ►  June (4)
    • ►  May (1)
    • ▼  April (3)
      • Build Array from String, Count Each Element Index
      • Parse File, Write to a Different File
      • Using VMware ESXi 5.5 for Virtual Networking Labs
  • ►  2014 (7)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (2)
  • ►  2013 (2)
    • ►  May (2)
  • ►  2010 (1)
    • ►  October (1)
  • ►  2008 (1)
    • ►  August (1)
  • ►  2007 (1)
    • ►  May (1)
  • ►  2006 (11)
    • ►  March (1)
    • ►  February (6)
    • ►  January (4)
  • ►  2005 (4)
    • ►  December (4)
Simple theme. Theme images by luoman. Powered by Blogger.