Friday 18 October 2013

Extract Records with Multiple Columns by searching Full String or a Partial String on any Column in a Flat (Excel) File-Similar to VLOOKUP

How to get this Script

Please send Email with Subject "Extract Records with Multiple Columns" to vijkid143@gmail.com for Zip File

Note: Customization can be done on Request

Description

Extract Records with Multiple Columns by searching Full String or a Partial String on any Column in a Flat File

This is complex to explain in terms of Flat Files. So I am taking a Database Example and relate it with this VBScript in handling the Flat Files

Database

Suppose we have an Employee Table EMP in Database which has Employee details (Multiple Records) and for each employee there are Columns such as EmpFirstName,EmpMiddleName, EmpLastName,EmpAddress,EmpCity,EmpState

 So if we need to identify Employees which has EmpFirstName containing

Ker
Joh
Mar
Ros
 

Then we write a Query as

SELECT * FROM EMP
WHERE
(

EmpFirstName LIKE '%Ker%' OR 
EmpFirstName LIKE '%Joh%' OR 
EmpFirstName LIKE '%Mar%' OR
EmpFirstName LIKE '%Ros%'
 )
 

Using the above Quey we can extract all the Records who have Names such as Kerry,John,Johnson,Mary,Mariah,Rosy,Rosannah etc
 

Challenge with Flat Files (Excel File)

So to acheive the same kind of Result from a flat File (Excel Sheet) is impossible as we cannot select the EmpFirstName Filter with Lot of Values with 

"Contains" Option as the Excel will allow only 2 Values with "Contains" Option
 

This VBScript and its Importance

So this VBScript is desgined for these kind of situations where we can extract Records with any number of Values with "Contains" Condition


How to Use it
1) Download the zip file (Please send Email with Subject "Extract Records with Multiple Columns"  to vijkid143@gmail.com for Zip File)
2) Unzip the Files
3) Open the Original.xlsx File (I have just placed my sample data for explanation. You can have your Data in the same way with any number of Records and any number of Columns)
4) Simply Copy the Data from Excel (Just leave the Column Names) and directly Paste it in File2.txt. Save the File2.txt and Close it
5) In the File1.txt. Enter all the string Values which need to be searched. You can have the Complete String like "John" or Part of the String Like "Joh" or "oh" etc. Save the File1.txt and Close it
6) Now Run the VBScript "EXTRACT SPECIFIC RECORDS BY SEARCHING DIFFERENT STRINGS ON ANY COLUMN.vbs"
7) In the "Enter the Number of Columns" Popup. Enter the Total Number of Columns. In this Example we have 7 Columns. So we Enter "7"
8) In the "Enter the Column Position which has to be searched" Popup. Enter the Column in which the Search has to be Done. In this Example we are searching for Employee FirstNames which is in 1st Position. So we Enter "1"
9) VBScripts Starts the Execution and Completes the Execution which you will see as Messages on the Screen.
10) Now Open the OUTPUT.TXT File and you will see only those Records which have Complete EmpFirstName Matching or Partial EmpFirstName Records


Visit My Other Blogs

http://exceljoins.blogspot.in/
http://wordcount-vbscript.blogspot.com/

Developed By: Vijay Uppara (Vijaya Bhasker M Uppara)

Please send your comments or Feedback to vijkid143@gmail.com




 

Sunday 1 September 2013

Identify the Duplicate Values and Distinct Values in a Flat File

How to get this Script

Please send Email with Subject "Identify the Duplicate Values and Distinct Values"  to vijkid143@gmail.com for Zip File 


Note: Customization can be done on Request

Description
1) This Script will identify the Duplicate Values which are present more than once in a File and will give the Count of the each Duplicate Value.

2) It also shows the Distinct Values


How to Use it
1) Download the zip file (Please send Email with Subject "Identify the Duplicate Values and Distinct Values"  to vijkid143@gmail.com for Zip File)
2) Unzip the Files
3) Fill in the input values in a Sorted Order in File1 from which the Duplicate values have to be identified
4) Run the Script GET DUPLICATE RECORDS.vbs
5) Once script execution is completed. Open the "1.DUPLICATES.txt" and "2.DISTINCT_VALUES_WITHOUT_DUPLICATES.txt" files
6) 1.DUPLICATES,txt File will have all the values which are present more than once in the Input File. In Summary section it also it will show the total count of values which have duplicates
7) 2.DISTINCT_VALUES_WITHOUT_DUPLICATES.txt will have all the distinct  values which are present in the Input File, In Summary section it also it shows the total count of Distinct values.

Youtube Video
http://www.youtube.com/watch?v=MPv5r-wfgzg

Visit My Other Blogs

http://exceljoins.blogspot.in/
http://wordcount-vbscript.blogspot.com/


Developed By: Vijay Uppara (Vijaya Bhasker M Uppara)

Please send your comments or Feedback to vijkid143@gmail.com






Thursday 22 August 2013

Multiple Columns Data Compare between two Files

How to get this ScriptPlease send Email with Subject "Multiple Column Compare"  to vijkid143@gmail.com for Zip File

Note: Customization can be done on Request

Description

This Script will compare the data between two files having MultipleColumns with multiple records

How to Use it


Prerequisites

1) First download the data from Database or Reports or some other Source in Excel spread sheets. You should have 2 Excel Sheets each having a data set to compared.


Run the Script
1) Download the zip file
(Please send Email with Subject "Multiple Column Compare"  to vijkid143@gmail.com for Zip File)
2) Unzip the Files

3) Simply Copy the Data from first Excel spreadsheets into File1.txt and second Excel Spreadsheet into File2.txt and save them
4) Run the Script GET_MATCHING_RECORDS_OF_FILE1.vbs

5) Enter the Number of Columns present in File1.txt and Click Ok
6) Enter the Primary Column Position Number. For Example. If Primary Column in in 4th Position Then Enter 4.
6) Once script execution is completed. Open the "Matches.txt" and "NoMatches.txt" files and "MatchesID_NoMatchesColumns.txt" Files
7) Matches File will have the exact Matches between File1 anfd File2
8) NoMatches file will have the PrimaryKeys Values present in File1 which are not present at all present in File2. In the sense there is no record at all

9) MatchesID_NoMatchesColumns.txt will have Primary Key Matches. But there will be atleast one mismatch in the rest of the Columns

Note: To find out the "Records present in File2 not present in File1". Run the other script "GET_MATCHING_RECORDS_OF_FILE2.vbs" which works the otherway round


Visit My Other Blogs

http://exceljoins.blogspot.in/
http://wordcount-vbscript.blogspot.com/

Developed By: Vijay Uppara (Vijaya Bhasker M Uppara)

Please send your comments or Feedback to vijkid143@gmail.com


 

Sunday 15 April 2012

Single Column Data Compare between two files

How to get this Script

Please send Email with Subject "Single Column Compare"  to vijkid143@gmail.com for Zip File

Note: Customization can be done on Request


Description
This Script will compare the data between two files having Single Column with multiple records




How to Use it
1) Download the zip file (Please send Email with Subject "Single Column Compare"  to vijkid143@gmail.com for Zip File)
2) Unzip the Files
3) Fill the values which are to be compared in File1 and File2 which acts as Input Files
4) Run the Script GET_MATCHING_RECORDS_OF_FILE1.vbs
5) Once script execution is completed. Open the Matches and NoMatches files
6) Matches File will have the common values between two input files
7) NoMatches file will have the "Records present in File1 not present in File2"


Note: To find out the "Records present in File2 not present in File1". Run the other script "GET_MATCHING_RECORDS_OF_FILE2.vbs" which works the otherway roundd

Visit Youtube Video for clear information
http://www.youtube.com/watch?v=cIrMZCLz3II


Visit My Other Blogs

http://exceljoins.blogspot.in/
http://wordcount-vbscript.blogspot.com/

Developed By: Vijay Uppara (Vijaya Bhasker M Uppara) 

Please send your comments or Feedback to vijkid143@gmail.com