How to compare two fields of two different files in perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • inês
    New Member
    • Sep 2010
    • 1

    How to compare two fields of two different files in perl

    hello!

    I need help whith perl.

    I have 2 files, i whant to open them compare one colun and if they iqual i whant to write at the 1ª file some coluns of the second file.

    Exemple:
    File 1

    2; apartamento; T2; manuel; 120.000€; Activo
    4; moradia; V4;José; 250.000€; Suspenso

    File 2
    12; manuel; arcozelo; 234567888; activo
    23; josé; Londres;0044444 44;Activo

    Result
    2; apartamento; T2; manuel; 234567888; 120.000€; Activo
    4; moradia; V4;José; 004444444; 250.000€; Suspenso

    Can you help me please.

    Inês
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    What part is giving you trouble?

    What have you tried?

    Have you read these perldoc's:
    perldoc -f open
    perldoc -f split
    perldoc -f splice

    Comment

    Working...