Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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, 05: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, 23:20
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Fort Polk, LA
Posts: 500
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

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