If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > Flat files comparison using PERL.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-08, 04:16
ashish nahata ashish nahata is offline
Registered User
 
Join Date: Feb 2006
Posts: 7
Flat files comparison using PERL.

Dear Gurus,,

Is there any way for doing the flat file comparison having the data in Dutch language (can be blind compariosn like position 15 to 20 in file 1 and file 2 are same). I have file 1 which is having the sample records say around 1000 and the another set of data I am extracting from the oracle table into a flat file 2.
A data validation needs to be done in file 1 and file 2. Using perl script how can I achieve this. I am very new to PERL..
Reply With Quote
  #2 (permalink)  
Old 06-19-08, 22:20
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Is there any way for doing the flat file comparison having the data in Dutch language

By "the data in the Dutch language" I take it you mean that the data uses Dutch accents. Since Dutch is represented by the standard ISO 8859-1 encoding, there shouldn't be an issue.

If you need to compare text without regard to accents, for example, é and e being treated as the same, this is how:

Code:
$text1 =~ tr/àáäâãåèéëêìíïîøòóöôõùúüû/aaaaaaeeeeiiiioooooouuuu/;
$text2 =~ tr/àáäâãåèéëêìíïîøòóöôõùúüû/aaaaaaeeeeiiiioooooouuuu/;
if($text1 eq $text2) { dostuff(); }
That's just an example. You can do more sophisticated stuff with regular expressions, too.

(can be blind compariosn like position 15 to 20 in file 1 and file 2 are same). I have file 1 which is having the sample records say around 1000 and the another set of data I am extracting from the oracle table into a flat file 2.
A data validation needs to be done in file 1 and file 2. Using perl script how can I achieve this. I am very new to PERL..


You say it "can" be a blind comparison, and that you have some records, "say around 1000" and some kind of validation "needs to be done."

This is all very vague. You need to spell out precisely what you want to do.

You don't know Perl, fine. Do this print out some sample data. Write a set of instructions in English or Dutch or whatever language you prefer. Give the instructions and the data to someone who is unfamiliar with this project. Now see if that person can follow those instructions without you being in the same room.

If they can't, fix the instructions. Once that person can follow the instructions without any help from you, post them here and we can turn them into Perl.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On