Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Comparing files in two different folders

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,40434
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Comparing files in two different folders
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Comparing files in two different folders - 12/5/2006 9:04:50 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
Hi

Right now i have to write a vbscript for comparing two files and generate the report.

here i got confuse the logic....I have Folder A and Folder B.Folder A has 10 files and Folder B has 10 files the file names are different so basically i need to check Against Folder B files in to Folder A files.The files are EDI formats.

Could you please help me in that...

Thanks
Ashok
 
 
Post #: 1
 
 RE: Comparing files in two different folders - 12/6/2006 6:55:07 AM   
  Country73


Posts: 732
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
Are you basically looking at a script to see if the same filename exists in both places, or are you looking at reading each file and making a list as to which files contain the same information?

(in reply to ashok_ganeshs)
 
 
Post #: 2
 
 RE: Comparing files in two different folders - 12/6/2006 7:24:37 AM   
  ashok_ganeshs

 

Posts: 92
Score: 0
Joined: 12/5/2006
Status: offline
First of all i would like to thanks for your reply.

I am not sure i explained the scenario correctly or not...but here is the one i will explain little bit more about that.

I have folder A in for ex: C:\271TestFile_folderA

It has 10 files for example : 271_T_2006-12-05T11-22-17_2tmpF513.txt like that

here is the content of that file for 271_T_2006-12-05T11-22-17_2tmpF513.txt

BR005415*20060801*1457~HL*1**20*1~NM1*2B*1*XYZ*****FI*526002033~HL*2*1*21*1~NM1*1P*2*TEST00001*****SV*774800100~HL*3*2*22*0~TRN*2*BR05_FACILITY_Numeric*9526002033~TRN*1*063393337783*0526002033~NM1*IL*1*TESST*TESTE*A***MI*46803327600

like wise i have 10 different files each files have different value in the TRN segment (Highlited in Red)...like wise i have files in Floder B also

Ex:  C:\271TestFile_folderB

File : 271_T_2006-12-05T11-45-38_3tmp9ED2.txt

Basically what i suppose to do

1) Read the file in the folderA and find it out the Highligted Value in RED(*BR05_FACILITY_Numeric*) and check the same value in folder B file.
Example :
271_T_2006-12-05T11-22-17_2tmpF513.txt file in Folder A has that value and 271_T_2006-12-05T11-45-38_3tmp9ED2.txt file in folder B also have the same value then compare both files line by line and generate the report.


hope i explained the scenario clearly...


Thanks in Advance

Ashok

(in reply to Country73)
 
 
Post #: 3
 
 RE: Comparing files in two different folders - 12/6/2006 7:25:41 AM   
  ebgreen


Posts: 4969
Score: 31
Joined: 7/12/2005
Status: offline
I'm going to lock this thread. Please continue discussion in http://www.visualbasicscript.com/m_40495/tm.htm

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ashok_ganeshs)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Comparing files in two different folders Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts