Problems comparing files

Hello guys,

I have another problem, let me try to explain, i have two files:

cat file1
2623559
2623562
2623565
2623568
2619503

cat file2
"53382743","6600000000000256053",30,2
"53382744","6600000000000256054",30,2
"53382745","6600000000000256055",30,2
"53382746","6600000000000256056",30,2
"53382747","6600000000000256057",30,2

I need to compare all the rows of file1 with a part of a row in file2, and if it match, write all the row of file2 into file3.

For example:

row of file1: 2623559
match with a row in file2:"53382743","6600000000000256053",30,2
so this row will be writed on file3: "53382743","6600000000000256053",30,2

Thanx for your help.:confused:

I don't understand .... 2623559 != 000256053?

Sorry, here the right example:

row of file1: 2623559
match with a row in file2:"53382743","6600000000002623559",30,2
so this row will be writed on file3: "53382743","6600000000002623559",30,2

Use nawk or /usr/xpg4/bin/awk on Solaris.

awk -F'","*' 'NR == FNR { 
  _[$0] 
  next 
  }
{ 
  f = $2
  sub(/[^0]*0*/, "", f)
  if (f in _) print
    }' file1 file2