[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

solution



Hello!

I wrote a little perl script, which tells the first difference between two
translation. It uses the #: lines.

Here is the source:
(you need to start it with two filenames, ie: ./podiff C.po hu.po)
#!/usr/bin/perl

sub nextoken
{
    $i=0;
    while (($i==0) && ($str1=<FILE1>))
    {
	$line1++;
	if ($str1 =~ /^\#\:/) 
	{
	    $i=1;
	}
    }
    while ($str2=<FILE2>)
    {
	$line2++;
	if ($str2 =~ /^\#\:/) 
	{
	    return 1;
	}
    }
    return 0;
}

$line1=0;
$line2=0;
open(FILE1,$ARGV[0]);
open(FILE2,$ARGV[1]);
while (&nextoken==1)
{
    if (!($str1 eq $str2))
    {
	print "$ARGV[0](line: $line1)\t: $str1";
	print "$ARGV[1](line: $line2)\t: $str2";
	exit;
    }
}
close(FILE1);
close(FILE2);


Risko Gergely



Reply to: