473,322 Members | 1,409 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,322 software developers and data experts.

C# validate contents of a file against another file

Hello All.

I have 2 Files.
File 1 - is a new file conataining some data and
File 2 is a predefined file in the system

Now when the user uploads his/her file for validation, I need to check each and every field in the uploaded file with file already present in the system.

Can anyone guide on how to proceed on this!
Dec 8 '10 #1
5 2989
GaryTexmo
1,501 Expert 1GB
I think we need a bit more in the way of details... what are some sample file contents, is the text going to be exact, are we looking at different order and formatting?

The general idea should be simple enough though...

Open file 1
Open file 2
Read first field in file 1
Search for field in file 2
Compare values
Repeat for next field
Dec 8 '10 #2
Hi.
The scenario is

The first file which is to be validated will have some fields lets say n(of varying types like numeric,text etc.)
The second file which will be the base file will have all the possible fields.

The operations to be done are -
1) Verify that the first file is having the same number of fields.
2) Names of the fields MUST match.
3) Data type should also match.
Dec 9 '10 #3
GaryTexmo
1,501 Expert 1GB
Ok, so it sounds like you've got a pretty good handle on what you want to do... what's your question?

Do you need to know how to access files, or is there something else you're unsure about?
Dec 9 '10 #4
actually..
i needed some help as in code to do it...
though i have coded some logic but its not working..

If any other logic is available on the net then I'd like to see it
Jan 4 '11 #5
GaryTexmo
1,501 Expert 1GB
I'm afraid I can't give you the code to do it... it's not my job to write your program for you. I've given you a pretty good outline and you've said you've got a good idea on what you want to do, so you just need to sit down and do it.

I'm quite happy to help you debug any code you have and work through problems, I can't (and won't) write the code for you and post it here.

I hope that seems reasonable...
Jan 6 '11 #6

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

Similar topics

0
by: cnu | last post by:
Hi, I have a combo, that lists out the functions present in a dll. The user will select one of them. Then the user will enter some values for the arguments of the selected function. Now, I have...
1
by: aevans1108 | last post by:
Greetings All If this is the wrong place to post this question, please give me a push in the right direction. Thanks. I know there has to be a simpler way to do this, but this is as simple a...
3
by: I_AM_DON_AND_YOU? | last post by:
In my program I am using the notepad file to read/write data. I don't want that someone should be able to delete/change the contents of that file by opening that file in Notepad or other editor. ...
3
by: Rushi | last post by:
Hi All, Is it possible to Validate XML against XSD using two different XML files. scenario: There are two different XML file, one file contain element and count information and other one...
0
by: First_step_to_xml | last post by:
Hi All, I am trying to take an xml file as input from user and update the sql database with this new data from the xml file. Before going to the step of updating the data in the database, i...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
7
by: christian.eickhoff | last post by:
Hi Everyone, I am currently implementing an XercesDOMParser to parse an XML file and to validate this file against its XSD Schema file which are both located on my local HD drive. For this...
1
by: JoeZ | last post by:
Hi all, I am using XMLValidatingReader to validate xml instance against schema. Now my question is: in the schema, it has the target name space. In the instance, it doesn't have the name...
2
by: hrishy | last post by:
Hi Does anybody have a python xample program to validate a xml file against a XSD. regards Hrisy
3
by: Sushant Panda | last post by:
I m trying to validating xml file against xsd file in vb6.0 but i m getting an error xsd file:(Aces_Dlr.xsd) <?xml version="1.0" encoding="UTF-8"?> <!--W3C Schema generated by XMLSpy v2010...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.