#!/usr/bin/perl $file1 = "dataout.txt"; open(fout, ">$file1"); $file2 = "datain.csv"; unless( open(fin, "<$file2") ) { die "error: could not open file '$file2':$!\n"; } # if while($line = ){ chop($line) @var = split(/;/;/;/; $line); $X = $var[0]; $C = $var[1]; $Zs = $var[2]; $a = $var[3]; $b = $var[4]; }