compare two text files for matching data

  • Permalink
  • submit to reddit
  • Email
  • Follow


HI 
 
I want to compare data in two separate spreadsheet files and store the matching data in another spreadsheet file.
 
like
 
1)reading data from two spread sheets
2)compare the data of fist one with second
3)writing the matched data to third one.
 
I am find difficulty in combining them to sort string bu string
pls help me in this 
 
thanks 
 
jyohti
0
Reply x9561 (148614) 11/2/2006 6:10:08 PM

See related articles to this posting


You're going to need to provide more information before anybody can provide specific help, such as: - Are these actual spreadsheets, as in Excel spreadsheets, or are these text files in which the information is tab-delimited?
- What are you using to read the files?
 - Is the data 1D or 2D?
- Are you comparing numbers or strings or both?
 - What are you trying to use to compare?
- What are you using to write the result file?
The best things to do is to provide a sample of what you're doing and a detailed explanation of what you're trying to accomplish. In other words, help us to help you.
0
Reply x9561 (148614) 11/2/2006 7:10:07 PM

hi
the spread sheet are like normal excel sheets .
my basic requirement is like comparing two text documents and storing the match data in a new file.
so i started like converting a text document to an array by using 'spread sheet to array' and compare each elements of one array to another array .
but not able to do that
so i asked for help
 
 
 
 
 
0
Reply x9561 (148614) 11/2/2006 9:10:09 PM

kindly go through this attach file
you will get an idea.
 
thanks


req.doc:
http://forums.ni.com/attachments/ni/170/213652/1/req.doc
0
Reply x9561 (148614) 11/2/2006 10:10:08 PM

hi
 
i am implementing the following logic 
 
1)  textfile1--------->string to array
                               
2)textfile 2--------->string to array
 
3) compare the elements (substring) of one array to other using for loop
 
4)append the match to an array every time you find a match betwwen two arrays
 
5)wriitng the result in new file
 
i am strugulling in with 3) i have finshed 1,2,4and 5 th part
 
problelms are with indexing and loop conditions for me...
 
anyways i am trying and feeling like i will finish and post that soon....
 
 
 
0
Reply x9561 (148614) 11/2/2006 11:40:08 PM
comp.lang.labview 35383 articles. 14 followers. Post

4 Replies
348 Views

Similar Articles

[PageSpeed] 21


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Comparing two input files
Hi there, I need a bit help. Here's my "compare-function": -------------- function comp(file1,file2) % ====================================== % Matlab script to compare 2 input-files % ====================================== % Read first character into char array (skipping rest of line) [file1_data]=textread(file1,'%3c%*[^\n]') [file2_data]=textread(file2,'%3c%*[^\n]') % Read the file like this, using NaN in empty cells: [data] = textread('data.csv','','delimiter',',','emptyvalue',NaN); -------------- As you see, it...

Compare Two Text file and update files only for missing entries ...!!!
We have index file (.txt) at Repository folder(local machine) as well as at the destination(USB device). Each index file is having more than 30000 Entries. Index file entry contains Driver name, PnPID and Path of INF file. Here Single INF file can have multiple entries. when we copy the repository folder from Source location to Destination, first We need to Compare Two index Files. And find out the exact missing entries that are present in source index file but not in destination index file. And we need to update index file as well as copy only those files for missing entries at...

data comparing....Two files.....
Dear all!! I have file of 3 fields and a master file. I want to compare two fields of my file with master file corresponding fields. My file UniqId Amount Name 123 345.00 Donald 356 458.00 Duck 789 356.00 Robert Master 123 345.00 Donald Add1 Add2 Add3 356 458.00 Duck Add1 Add2 Add3 789 356.00 Robert Add1 Add2 Add3 125 588.00 Mc Add1 Add2 Add3 I want to check the first two fields with the corresponding Master fields. If both fields matches with the master fields then print Myfile fields and all master fields. If the ...

compare two text files
Hi, I want to compare two text files(contains numbers) and I need a shell script for this to get what are the simmilar fiels and the differents fiels in these two text files (the result can be in another files). an example of these two files: file1: 34556678 33236789 32223456 31458909 30113256 file2: 33557890 31458909 33236789 30113256 33556788 Thanks a lot for your help. On 22 Feb., 11:04, "Unix_shell" <marouane.s...@gmail.com> wrote: > Hi, > > I want to compare two text files(contains numbers) and I need a shell > script for this to get what are the simmilar f...

Comparing Two Text Files
Hi all, As everyone is probably aware, I'm weak when it come to VB. But I'm also very interested in learning more about it. How do I compare two text files? I want to be able to compare FileA with FileB. If the two text files have the same text (customer number) then line from FileA and FileB into FileC. If I have a file that columns seperated by "," and another that has columns seperated by "|", how do I print only a portion of each file. Say I want to print a row of text, but start at the third word in. Logically it makes sense to count "," but I'm...

Comparing two data files
Would you help me to solve the following problem: Two persons entered the same data in SPSS. So I have two separate SPSS-Files with identical variables names and number of cases. I want to check whether each value in the two data files are exactly the same by using SPSS (syntax) program. I have to compare two data files repeatedly, so the program should have a general form. It would be helpful if the output would list for each case (ID) the differences for each variable (see the example below). Example File 1 ID v1 v2 v3 vn 1 1 3 55 6 2 2 5 57 7 3 2 4 59 4 File 2 ID v1 v2...

Matching records from data set one with records from data set two and deleting a record from data set two
Hi I need to match records from data set one with records from data set two. I can only match records from data set two to a single record in data set one. Therefore i need to delete the record in data set two or show that it has been used, and thererfore can not be used again. Have do i do that? I have been trying some thing like this: Data newdataset; set one; found=0; do i=1 to nobs until (found); set two point=i nobs=nobs; if var1=var2 (the matching criteria) then do; output; found=1; ***I need to delete the record in da...

How to compare two large text files?
Hi,I have two text files, text1.xml and text2.xml. text1.xml is the bench mark file and text2.xml is generated by my Java program. In my junit test, I want to compare the generated text2.xml against the bench mark file text1.xml. The bench mark file text1.xml is much bigger than text2.xml, because it has other lines in it. All the lines in text2.xml, except a few lines containing timing information, should find a match in text1.xmlIn another words, lines 2 to 1101 in text2.xml should be identical with lines 850 to 1949 in text1.xml; lines 1103 all the way to the end in text2.xml should be iden...

want to compare data in two files.
I have two CSV files and i want to find the duplicates records. For ex. Sheet1 Sheet2 Vipul Anthony John Wayne Mac Bill smith randy Nick thalia Trishi ricky sachin Nick So i want to check th...

comparing data in two mat files
Hi, Is there any quick way to compare data in two mat files? These mat files are huge...the dimension is 17544 x 1000. Therefore, it may be too slow to first convert them to CSV files and compare. Thanks, Alan ...

Compare the size of two text files
Hello Is there a possibility in matlab to comare two files, which on is bigger in size? Cheers Silvija Hi Silvija, help dir dir called as a function returns among other things the size... Titus "Silvija" <silvija_no@hotmail.com> schrieb im Newsbeitrag news:ef347aa.-1@webx.raydaftYaTP... > Hello > > Is there a possibility in matlab to comare two files, which on is > bigger in size? > > Cheers > Silvija ...

comparing two files for best match
--nextPart2049084.fqK7v6JRGL Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Hi, I have two files that look something like below: File 1 ---- 25.06.12,13:00:02,44,45 25.06.12,13:00:08,43,45 25.06.12,13:00:14,44,45 25.06.12,13:00:20,44,45 25.06.12,13:00:26,43,45 25.06.12,13:00:32,43,44 25.06.12,13:00:38,43,44 25.06.12,13:00:44,43,44 25.06.12,13:00:50,43,44 25.06.12,13:00:56,43,44 25.06.12,13:01:02,43,44 File 2 ---- 13:00:04,stop_hge,5.31,2.68,21.69,79.8,42.8,52.6,216,18 13:00:16,stop_hge,5.3,2.68,21.65,79.5,42.5,52.3,215,17...

Separate data from text in a txt file? or fetch the data in txt file
hello, I have a txt file as in the below. And what i am trying to do is to be able to fetch my data and plot them. i have been using 'fscanf' but i wasn't able succeed. i was wondering if anyone knows an easy way to separate data from a txt or dat file, so that i can use just the 'load' function to process my data? Field Output reported at nodes for part: PART-1-1 Computation algorithm: EXTRAPOLATE_COMPUTE_AVERAGE Averaged at nodes Averaging regions: ODB_REGIONS Node U.U2 S max S.S11 Label ...

Extracting lines from a text file that match a certain criteria to another text file
Hi, I am novice UNIX shell programmer and would like some help. I am trying to write a shell script that will read a text file line by line. The task is to extract lines from the text file that meet a set of criteria to another text file. An example of the text file, foo2, that I am using is shown below, 0,0,"NBSC",12,"24/02/2004 15:35:34","RD","2.2" 1,1,"ORG-UNIT-TYPE","C",1,"13/03/1997 17:24:49","PO" 1,2,"ORG-UNIT-TYPE","C",2,"13/03/1997 17:24:49","Client" 1,3,"ORG-UN...

is there a utility to compare two non-text files?
I know I can use diff to compare two text files but is there a utility to compare two large non-text files? RolandRB said the following, on 03/29/06 14:43: > I know I can use diff to compare two text files but is there a utility > to compare two large non-text files? > If you have the GNU utilities, there is cmp(1). -- Rich Gibbs richg74@gmail.com "You can observe a lot by watching." -- Yogi Berra On 2006-03-29, RolandRB wrote: > I know I can use diff to compare two text files but is there a utility > to compare two large non-text files? cmp -- Chris F.A....

Comparing two book chapters (text files)
Hi all, So I have an interesting challenge. I want to compare two book chapters, which I have in plain text format, and find out (a) percentage similarity and (b) what has changed. Some features make this problem different than what seems to be the standard text-matching problem solvable with e.g. difflib. Here is what I mean: * there is no guarantee that single lines from each file will be directly comparable -- e.g., if a few words are inserted into a sentence, then a chunk of the sentence will be moved to the next line, then a chunk of that line moved to the next, etc. * Also, ...

Fastest algorythm for... (comparing two text files)
Two text files containing simple lists of strings: ____________ File #1: Aaaa Ffff Gggg Hhh X C File #2: Aaaa NewEntry#1 Ffff Gggg Hhh NewEntry#2 X C ____________ What is the fastest way in VB6 to compare the two files, and find entries in File #2 that are not in File #1? (i.e. "NewEntry#1" and "NewEntry#2"). I know I can open file #2 and compare each line to all lines in file #1 with two nested loops, but there has to be a faster way... right? :-) TIA Calan > Two text files containing simple lists of strings: >...

convert mat files (struct) to ascii text files / save data as ascii text
I'm using a script that saves data (x,y) as .mat files in struct format. However I need it to save the data as ascii text files. How can this be done? I've tried save -ascii etc etc but matlab returns that the data format is not suitable to save as ascii. So is there a (simple) way to either save my data as ascii text or convert a generated .mat file to ascii text file (CSV or else)? Thanks! On Dec 23, 10:43=A0am, "Stijn Oonk" <stijn.o...@tno.nl> wrote: > I'm using a script that saves data (x,y) as .mat files in struct format. = However I need it to sav...

Matching data from two files using Python programmability
Hi all I am trying to learn Python for SPSS and I found an interesting post on the SPSS DevCentral site about how it is possible to take two files and match them to each other so that you can get certain geographical information. For example in File 1, I have Zipcodes Cities And these cases are all unique, because they are a sample from survey data. In File 2, I have a master file that lists all geographical information in US, which I got from Geonames.org : Zipcode State City Geolocation (latitude and longitude) If I wanted to use some kind of vlookup function to map...

How to compare two SOAP Envelope or two Document or two XML files
Hi All, I am testing a web service. I need to compare the SOAP Response i got from the web service with the xml present with me as expected output. i means to say i am receiving SOAPEnvelope using call.invoke() function and i want to compare this envelope with another XML file. Could anyone help me out please? Thanks in Advance, Deepak Kumar Infosys Technologies Ltd. GenxLogic napisal(a): > Hi All, > I am testing a web service. > I need to compare the SOAP Response i got from the web service with the > xml present with me as expected output. i means to say i am receiving > S...

how can i compare two m-files with the 99% same code (ie fidn the difference between two m-files)
I have two files that are the same but produce different answers to the parameter I am trying to calculate. The m- file is abt 5000 lines long so I am not quite sure where to start. I know I must have changed some calculation somewhere but it will be a minor change which i want to find out. Is there a way I could compare both files to find out where they differ? thanks in advanc efor any help! "M K" <maha_k@mathworks.com> writes: > I have two files that are the same but produce different > answers to the parameter I am trying to calculate. The m- &g...

compare 2 data files and extract fields for matched lines
Hello Friends, The best way to describe what I'm trying to do is through an example. I have 2 pipe delimited input files and want to extract a field from file 2 and append it to file 1. Note I would like Output file to have the same number of rows as Input File 1, with an additional field whose value if present in file 2, should be inserted in this new field. If its not present, then insert '0000'. Input File 1 (zipcode, city, state, county) 36003|Autaugaville|AL|AUTAUGA 36006|Billingsley|AL|AUTAUGA 72314|Birdeye|AR|CROSS 72324|Cherry Valley|AR|CROSS 57437|Eureka|SD|MCPHERSON 67...

Reading two different types of data from one text file?
Hey Everyone, Another begginer here, I am trying to extract read some data from a text file, data looks like this: a b c d e a b c d e .... .... .... a b c d e a=being string b= being double etc I can read those fine in an 1x5 cell array and than use the data with { }. The problem is when my text file looks like this: a b c d e a b c d e .... a b c d e q y x q y x q y x .... q y x Is there a way to read the first part of the textfile in 1x5 cell array and than read the second part into another 1x3 cell array? I am sure there is and I would like to figu...

how to separate datas and text from a text file
Dear Sir/madam, I am doing a simulation. I got a output file which has alternate text and datas. The file is very huge(12 laks line). I want to remove all the text and i want to save only the datas into a file. Can any one suggest me how to do it in matlab. This is the kind of output file i have EATOM 1 # type x y z epot ( eV) ekin ( eV) #----- ---------- ---------- ---------- ------------- ------------- 2 14.3300 15.7630 15.7630 -1.409238e+01 +1.378315e-01 EATOM 1 # type x y z epot ( eV) ekin ( eV) #----- ----...