Hi; I created a program that needs to parse through multiple files
looking for users and groups. The users are listed with Employee
Number and Name and then Groups. The format is as follows:
C008658 Smith,John
C009525 Smith, Jane
C014259 Doe, Joe
C044888 Doe, Jack
*******************************************************(yes, the stars
are part of the file)
Outsource Access Control Sheet - Finance
Project Manager: Gilmore, Happy (0083234)
Date of first approval: Not approved
Date of last update: First Update
Accounts:
Type: LAN
Groups: Yes-Some-Type-of_Group
I need to capture, the employee ID, Name, and Groups. My Current
program is not working to well. Here is ONE of the version of the
program I am working on to get it to work.
Cemployee=Array.new
CemployeeID=Array.new
CemployeeName=Array.new
counter=0
CemployeeS=" "
File.open(“D:\Finance.txt”).each { |user|
while user.scan(/^[*]+/)
CemployeeID[counter]=user.scan(/^[C]\d+/)
puts CemployeeID[counter]
CemployeeName[counter]=user.scan(/\s\w+[,]\w+/)
puts CemployeeName[counter]
counter+=1
end
}