473,324 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Trying to Compare 2 txt files using VB Script

I've never writen any VB Script before and need as much help as i can get with this issue. I need a VB Script that will do the following:

Expand|Select|Wrap|Line Numbers
  1. open TxtFile1.csv
  2. for each line in file
  3.       save visit ID into array 
  4. close TxtFile1.csv
  5. for each visit ID in array
  6.       search txtFile2 for match
  7.       if match
  8.             save entry into new file
Any help with this would be much appreciated!
Apr 30 '07 #1
1 1807
Killer42
8,435 Expert 8TB
I've never writen any VB Script before and need as much help as i can get with this issue. I need a VB Script that will do the following:

Expand|Select|Wrap|Line Numbers
  1. open TxtFile1.csv
  2. for each line in file
  3.       save visit ID into array 
  4. close TxtFile1.csv
  5. for each visit ID in array
  6.       search txtFile2 for match
  7.       if match
  8.             save entry into new file
Any help with this would be much appreciated!
Well, let's see. To open the file you can use the Open statement (funny, that).
Then something like a Do Until Eof(filenumber) loop, and Line Input #filenumber, StringVariable to read your CSV file. The Split() function can be used to pick apart each line into fields (presumably splitting on commas).
To resize an array to make room for another entry, use ReDim Preserve.

Is that any help in getting you started?
Apr 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Evgeny Gopengauz | last post by:
Hello all! My question is: how to compare two database structures if I only have their DDL files? As the result I would expect an sql-script upgrating one database structure to another. The...
4
by: Mark J. McGinty | last post by:
Greets, Part of the content of one of our web pages uses wingdings and Chr(239) through Chr(242) (which are little arrow outlines, though that's not really important.) It worked just fine in...
2
by: david | last post by:
hi: The file can be PDF or Word format. Any help? thx
0
by: thomas.hauser | last post by:
hello, I'm writing a application that is using 2 xml-language file. I want to avoid to maintain both xml-files - that's why I"m writing a script which shall compare both xml and add missing...
5
by: drabee | last post by:
Please help 2 things: 1-I need c# code to compare 2 audio files .or any other .net code 2-code to receive bluetooth file from mobile and save it using .net code
0
by: niTT | last post by:
Hi, I'm new to python, as in I read the first 5 chapters of 'dive into python' new. I'm trying to use the levenshtein algorithm to do some edit distance comparisions. However rather than...
2
by: Viewer T. | last post by:
I am trying to write a script that deletes certain files based on certain criteria. What I am trying to do is to automate the process of deleting certain malware files that disguise themselves...
0
by: TimKnoll | last post by:
I want to compare to large (4+ MB) XML files from a C# program. I'm currently using The XML Diff and Path tool from Microsoft's site. The performance on the larger files isn't acceptable. Has...
2
by: m | last post by:
I have a script I would like to write but I am not sure of where to start / approach. Perhaps someone could help direct me in the right direction. Any advice is appreciated. I would like to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.