Data Masking VBScript

Author Message
anchitj

  • Total Posts : 5
  • Scores: 0
  • Reward points : 0
  • Joined: 3/27/2011
  • Status: offline
Data Masking VBScript Sunday, March 27, 2011 4:48 PM (permalink)
0

Hello Experts,
 
I want to design a data masking vb script. My requirement is below:
I am having a text file with suppose 10 columns. Out of these 10 columns i want to mask 2 columns and generate the new text file. Here by masking i mean the original values in these 2 columns will change to some artificial values.
 
Can anyone help me with the logic/code. I am new to vbscript.
 
Thanks,
Anchit
 
#1
    ehvbs

    • Total Posts : 3320
    • Scores: 112
    • Reward points : 0
    • Joined: 6/22/2005
    • Location: Germany
    • Status: offline
    Re:Data Masking VBScript Monday, March 28, 2011 12:26 AM (permalink)
    0
    First step to be a programmer: learn to read - e.g.
     
    Show off your completed VBScript or code snippet here. Do not post Questions here, only completed scripts please. Script should be useful and created by you.
     
    #2
      anchitj

      • Total Posts : 5
      • Scores: 0
      • Reward points : 0
      • Joined: 3/27/2011
      • Status: offline
      Re:Data Masking VBScript Monday, March 28, 2011 6:12 PM (permalink)
      0
      My bad :( i missed that 1...
      Below is the script i am using:
      ============================
      Dim arrFields
      src =  "d:\src.txt"
      tgt = "d:\tgt.txt"
      Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile(src,1)
      Set objFileToWrite = CreateObject("Scripting.FileSystemObject").OpenTextFile(tgt,2)
      Dim strLine
      do while not objFileToRead.AtEndOfStream
      strLine = objFileToRead.ReadLine()
      arrFields = Split(strLine, vbTab)
      Wscript.Echo arrFields(2)
      objFileToWrite.WriteLine(strline)
      loop
      objFileToRead.Close
      Set objFileToRead = Nothing  
      ===========================
        
      Here i want to modify the 3rd column arrFields(2), so the code
      Wscript.Echo arrFields(2)
      needs to be replaced with the code which can change the value of the column.
       
      Could you please help?
       
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9