techadmin32 Posted September 7, 2013 Posted September 7, 2013 (edited) I just got a nice job after I got out of the military but I really need to make myself more useful so that they will decide to keep me. I've been working very hard to make the best impression here so this would really help in making me stand out. If you help me with that script it will help me so much. This script would simplify the work I do and take a job that takes 10 minutes to do per job and condense it to a matter of seconds. Here is what I need. I need to create a text file that takes user input and separates each word provided and separates them by a | or a series of pipes. I need the script to ask the user for the new hire's login, the new hires name, the cost center, the vendor, the manager, the date of birth, and "is there another new hire;" which would then prompt the script to run through the questions again to provide a second line of out put and a third etc etc. until the user ansers "no" to the new hire question. Now, the output from each series of the 6 questions needs to contain the users input plus the pipes with a few special additions to the output. Basically, in out organization we assign a user ID that is a letter and then a number which may have the letter A at the end. That will be provided by the user in the first question, First question: "What is the new hires login?" the script will take that login name for the first question and the text it will add first to the line of output will look like this: N55555A|55555A *Notice that here the new hire's login is generated twice but the second time the first letter is not present. This must be this way for future reporting and auditing. If another question asking for the last 6 of the user's login needs to be added to create this line that will work. The second question, "What is the new hires first and last name?" It will take that in put and add the | signs in the following manner: N55555A|55555A|Jon|Doe The next question: "What is the new hire's cost center?" That input will be added to the line with the pipes like so: N55555A|55555A|Jon|Doe|||||||||||||55555 The next question: "What is the new hire's vendor company name?" That input will add to the output line as follows: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC The next question: "What is the new hire's location code?" That input will add to the output: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters|||||||||||||| The next question: "What is the hiring manager's user ID?" That input will add to the line with the pipes as follows: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U451492|451492 *Notice that here the manager's login is generated twice but the second time the first letter is not present. This must also be this way for reporting. If another question asking for the last 6 of the user's login needs to be added to create this line that will be fine. The next question: "What is the last 6 of the new hire's ssn or what is 2 digit month, 2 digit day, and first and last initial in capital letters?" In some situations the new hire may not have an ssn so the date of birth needs provided. Either way that input needs to be added at the end of the line of text as follows: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U555555|555555||||0304JD The next question the answer will not be recorded in the text file that will be generated at the end. "Is there another new hire?" The answer to the above question will either prompt the script to run through the questions again to create an additional line of data for an additional new hire or it will prompt the script to save the line of text created by the script to a text file on the user's desktop and close. If the answer to the next question is Yes it will save the additional line of data underneath the first line like so: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U555555|555555||||0304JD N55556A|55556A|Jane|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U555555|555555||||0203JD I need this script to create the above text based on the questions into a text file so I can copy that text and paste it into another program. I would appreciate the help so much as it would help me keep my job in this economy. Thank you very much for any help. Edited September 7, 2013 by techadmin32
MordyT Posted September 8, 2013 Posted September 8, 2013 I'd be willing to work on something here for you... Just won't be finished overnight. When do you need it by? Please don't say asap...
techadmin32 Posted September 8, 2013 Author Posted September 8, 2013 (edited) thanks for responding! no theres no hurry. its not a task I was given or anything. it would just be something really cool I could bring to the table that would make a lasting impact. I want to make an impression by taking something that I think could be automated and it needs to be done daily so it would be a tremendous time saver. I'm taking responsibility for something to ease the workload so what better way to do it then with this script. there is a heavy workload; which is good, lol. job employment. but ya, I'm wasnt asked to do it and its just a secret project I'm working on so once its all set I can present it to the table. Thanks again! it would be so awesome. Edited September 8, 2013 by techadmin32
MordyT Posted September 8, 2013 Posted September 8, 2013 (edited) I just got a nice job after I got out of the military but I really need to make myself more useful so that they will decide to keep me. I've been working very hard to make the best impression here so this would really help in making me stand out. If you help me with that script it will help me so much. This script would simplify the work I do and take a job that takes 10 minutes to do per job and condense it to a matter of seconds. Here is what I need. I need to create a text file that takes user input and separates each word provided and separates them by a | or a series of pipes. I need the script to ask the user for the new hire's login, the new hires name, the cost center, the vendor, the manager, the date of birth, and "is there another new hire;" which would then prompt the script to run through the questions again to provide a second line of out put and a third etc etc. until the user ansers "no" to the new hire question. Now, the output from each series of the 6 questions needs to contain the users input plus the pipes with a few special additions to the output. Basically, in out organization we assign a user ID that is a letter and then a number which may have the letter A at the end. That will be provided by the user in the first question, First question: "What is the new hires login?" the script will take that login name for the first question and the text it will add first to the line of output will look like this: N55555A|55555A *Notice that here the new hire's login is generated twice but the second time the first letter is not present. This must be this way for future reporting and auditing. If another question asking for the last 6 of the user's login needs to be added to create this line that will work. The second question, "What is the new hires first and last name?" It will take that in put and add the | signs in the following manner: N55555A|55555A|Jon|Doe The next question: "What is the new hire's cost center?" That input will be added to the line with the pipes like so: N55555A|55555A|Jon|Doe|||||||||||||55555 The next question: "What is the new hire's vendor company name?" That input will add to the output line as follows: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC The next question: "What is the new hire's location code?" That input will add to the output: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters|||||||||||||| The next question: "What is the hiring manager's user ID?" That input will add to the line with the pipes as follows: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U451492|451492 *Notice that here the manager's login is generated twice but the second time the first letter is not present. This must also be this way for reporting. If another question asking for the last 6 of the user's login needs to be added to create this line that will be fine. The next question: "What is the last 6 of the new hire's ssn or what is 2 digit month, 2 digit day, and first and last initial in capital letters?" In some situations the new hire may not have an ssn so the date of birth needs provided. Either way that input needs to be added at the end of the line of text as follows: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U555555|555555||||0304JD The next question the answer will not be recorded in the text file that will be generated at the end. "Is there another new hire?" The answer to the above question will either prompt the script to run through the questions again to create an additional line of data for an additional new hire or it will prompt the script to save the line of text created by the script to a text file on the user's desktop and close. If the answer to the next question is Yes it will save the additional line of data underneath the first line like so: N55555A|55555A|Jon|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U555555|555555||||0304JD N55556A|55556A|Jane|Doe|||||||||||||55555||Personnel Consulting LLC|Headquarters||||||||||||||U555555|555555||||0203JD I need this script to create the above text based on the questions into a text file so I can copy that text and paste it into another program. I would appreciate the help so much as it would help me keep my job in this economy. Thank you very much for any help. I finished it... was able to reuse most of my code for a similar project. V1.0 is uploaded at http://mordyt.com/edu/NewHire.exe The first time it runs, it will give you a PC hash that you will need to send back to me, I will generate a license file for your use. (You can ignore the name/e-mail part, all I need is the hash) Test it out, let me know your feedback. http://mordyt.com/edu/1.PNG http://mordyt.com/edu/2.PNG Edited September 8, 2013 by MordyT 2
edutech4schools Posted September 8, 2013 Posted September 8, 2013 Google forms has this all built in I think and is free and ready to go. https://support.google.com/drive/answer/87809?hl=en
plexer Posted September 8, 2013 Posted September 8, 2013 Is the last 6 of the new hire's and managers logins automatically populated? if not it should be. Ben
MordyT Posted September 8, 2013 Posted September 8, 2013 Is the last 6 of the new hire's and managers logins automatically populated? if not it should be. Ben It will be in the next version. Just waiting on feedback to see what else may be needed.
techadmin32 Posted September 8, 2013 Author Posted September 8, 2013 It works great. I really like it so hopefully we will be able to use it. I know they have a software approval process and I think it would be awesome. The only thing that I think might be a road block is its too advanced for what my boss thinks. its hard to change old dogs, ya kno? If it was a little simpler like a vbs script that we could edit because there are other signs other than the | sign that we use and I could play with the script with other situations because ascript that does this would be very versatile. I think so many people could use it in data entry jobs. this is the first IT job ive had that has a data entry feel to it. its an infosec position and to me it reminds me of HR work. im used to AD admin type work.
plexer Posted September 8, 2013 Posted September 8, 2013 (edited) Here's a vbscript that will do it 'New Hire script plexer 08/09/2013 Option Explicit dim h_login, h_login2, h_forename, h_surname, h_ccentre, h_vendor, h_loc, h_manid, h_manid2, h_ssn, x, strfile, objFSO, objFile strFile = "c:\path_to_file_here\test.txt" Sub GetInput() Do While X = 0 h_login = InputBox ("Please enter login","Step 1") If h_login = "" Then Wscript.Echo "You must enter a login." Else h_login2 = right(h_login,len(h_login)-1) Exit Do End If Loop Do While X = 0 h_forename = InputBox ("Please enter forename","Step 2") If h_forename = "" Then Wscript.Echo "You must enter a forename." Else Exit Do End If Loop Do While X = 0 h_surname = InputBox ("Please enter surname","Step 3") If h_surname = "" Then Wscript.Echo "You must enter a surname." Else Exit Do End If Loop Do While X = 0 h_ccentre = InputBox ("Please enter a cost centre","Step 4") If h_ccentre = "" Then Wscript.Echo "You must enter a cost centre." Else Exit Do End If Loop Do While X = 0 h_vendor = InputBox ("Please enter vendor details","Step 5") If h_vendor = "" Then Wscript.Echo "You must enter vendor details." Else Exit Do End If Loop Do While X = 0 h_loc = InputBox ("Please enter location","Step 6") If h_loc = "" Then Wscript.Echo "You must enter a location." Else Exit Do End If Loop Do While X = 0 h_manid = InputBox ("Please enter managers ID","Step 7") If h_manid = "" Then Wscript.Echo "You must enter managers ID." Else h_manid2 = right(h_manid,len(h_manid)-1) Exit Do End If Loop Do While X = 0 h_ssn = InputBox ("Please enter SSN","Step 8") If h_ssn = "" or len(h_ssn) <> 6 Then Wscript.Echo "SSN not entered or not 6 characters." Else Exit Do End If Loop End Sub Call GetInput set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile(strFile, 8, True) objFile.WriteLine(h_login & "|" & h_login2 & "|" & h_forename & "|" & h_surname & "|||||||||||||" & h_ccentre & "||" & h_vendor & "|" & h_loc & "||||||||||||||" & h_manid & "|" & h_manid2 & "||||" & h_ssn) objFile.Close Doesn't loop back to the beginning automatically atm but you can just re-run it and it appends to the file you set at the top. Bennew_hire.vbs Edited September 8, 2013 by plexer 1
techadmin32 Posted September 8, 2013 Author Posted September 8, 2013 I tried to run it and i think line 2 had an extra comma and then I went to run it again. Now, im working on line 89. Its the one where it adds in the pipes. For some reason it doesnt like that line. I'm really getting more interest in vb these days. If you know a good book I'll get a copy and check it out. At the end of line 2 I got an expected identifier error and it looked like after objfso, was making the script expect another identifier? lol, so i deleted the comma. i really have no idea i was just guessing but line 89's got me.
MordyT Posted September 8, 2013 Posted September 8, 2013 (edited) Well, if you decide to go with mine, a new version is at http://MordyT.com/edu/NewHire1.exe that doesn't ask for the last 6 of the ids... It grabs from the first input. Edit:screenshot added: http://MordyT.com/edu/3.PNG Edited September 8, 2013 by MordyT 1
techadmin32 Posted September 8, 2013 Author Posted September 8, 2013 Both your responses are outstanding and I'm going to bring up both of them. The vbscript gave me a permission denied after i went through it. I don't it would act like I cant save to my own desktop. I think thats what might be causing it, a permissions issue maybe? I'm I really love Mordy's exe but my boss has his way of doing things and it might be too much legwork for him because he'd have to approve it. It would be useful to all our home workers so I am still going to let him check it out. Home users use their home PC so this is great for them no matter what. At the corporate office where things are stricter that VBscript is perfect because its easier for us to use without the hassle of getting other managers to approve it. Home users though will definitely appreciate the exe without a doubt so both of them will be used. Thanks so much really. I just signed up for the website and I am really impressed. Great resource!
plexer Posted September 8, 2013 Posted September 8, 2013 Sounds likely to be permissions for where you're saving the file. Ben
techadmin32 Posted September 8, 2013 Author Posted September 8, 2013 (edited) It says the errors in line 86 char 1. I don't see the error? it looks like it makes sense to me. I'm on my home machine and I'm logged in with the admin account. I cant see any thing that looks out of place. I'm thinking if I'm looking at the right line its trying to save it. I cant get it to the part where it saves the file so I can't see if the vbscript works as far as generating the input in the form of a text file with the pipes. I edited this line like so strFile = "c:\Users\username\Desktop\NewHireImports.txt" Thanks for the help Ben and MordyT! Edited September 8, 2013 by techadmin32
plexer Posted September 8, 2013 Posted September 8, 2013 Change strFile at the top of the script to a valid location. Ben
MordyT Posted September 9, 2013 Posted September 9, 2013 New version without license checks (I hope) is at http://mordyt.com/edu/NewHire2.exe Sorry about them, when I copied my old project over (the requirements were similar), it had the license check as well.
techadmin32 Posted September 13, 2013 Author Posted September 13, 2013 Sorry about that Mordy. I cant grab it right now because I'm at the office but I will when I get home. Our homeusers are very interested in it. I brought it up at our last meeting and we are all looking forward to revamping the process. You guys were a tremendous help and now I'm going to finish my degree, hehe. kind a inspired me.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now