469,898 Members | 1,586 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Validating flat files

Hi,
I am kinda new to programming and am in the process of implementing an application which is expected to parse/read data from flat files and display errors to the user about missing/invalid data. It would be required that the application opens the file in any editor(ultra edit) and take the user to that point of the file, which needs correction.

My approach towards getting started with this is
1. come up with an XSD depending on the requirements of the application.
2. Convert flat files into xml and then validate the xml file against the XSD.

I also did read about customising xml reader to read the stream of data that is in any format and then validate the outcoming xml against the XSD.

My question is:
1. Is this the right/efficient approach towards the kind of requirements that I have.
2. Flat files that I'll be handling will hold tab delimited data.
For Eg: Line 04A would contain all the info about the borrower.
Line 04A position 157 will be the SSN that expects integer varying b/w 9-11 digits.
While converting this file into a standard xml file using a customised xmltextreader, would I just read a single line and while doing so, plug in bunch if - else statements, thus writing equivalent XML tags????
I am a bit confused here........Plzz help!
Apr 9 '07 #1
3 1906
AricC
1,892 Expert 1GB
Hi,
I am kinda new to programming and am in the process of implementing an application which is expected to parse/read data from flat files and display errors to the user about missing/invalid data. It would be required that the application opens the file in any editor(ultra edit) and take the user to that point of the file, which needs correction.

My approach towards getting started with this is
1. come up with an XSD depending on the requirements of the application.
2. Convert flat files into xml and then validate the xml file against the XSD.

I also did read about customising xml reader to read the stream of data that is in any format and then validate the outcoming xml against the XSD.

My question is:
1. Is this the right/efficient approach towards the kind of requirements that I have.
2. Flat files that I'll be handling will hold tab delimited data.
For Eg: Line 04A would contain all the info about the borrower.
Line 04A position 157 will be the SSN that expects integer varying b/w 9-11 digits.
While converting this file into a standard xml file using a customised xmltextreader, would I just read a single line and while doing so, plug in bunch if - else statements, thus writing equivalent XML tags????
I am a bit confused here........Plzz help!
I am not very familiar with XML this may need to be moved to the XML forum. Is the originl file an XML file? This may be much easier if it were just a plain text file.
Apr 9 '07 #2
Motoma
3,237 Expert 2GB
I would strongly suggest against parsing a flat file with a rigid format structure to an XML document, as you could just create one large regular expression to validate the entire file, or on a line by line basis.
Apr 10 '07 #3
Thank you for all the help.
The requirement is :
1.Convert flat file to xml(Need help with this part. Would I come up with a custom xmltextreader to convert falt file into xml or is there any other efficient way)
2.Validate xml against an xsd( I beleive I can accomplish this using xmlvalidating reader).
3.When invalid data is found, open up the flat file in an editor and take the user to that line/position where data needs to be corrected(like it happens in visual studio IDE).
Apr 11 '07 #4

Post your reply

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

Similar topics

1 post views Thread by Steve Jenkins | last post: by
2 posts views Thread by championsleeper | last post: by
13 posts views Thread by raykyoto | last post: by
22 posts views Thread by Daniel Billingsley | last post: by
6 posts views Thread by Peter | last post: by
232 posts views Thread by robert maas, see http://tinyurl.com/uh3t | last post: by
9 posts views Thread by =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post: by
15 posts views Thread by lxyone | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.