I would map the file as an external table as one line, so you can select the entire line (note: external table - do not load the data into a table, use an external table)
ops$tkyte%ORA10GR2> select x from t;
X
----------------------------------------
1,2,3,4,5,6,7
1,,3,4,5,6,7
1,,3,,5,6,7
1,,,,5,6,7
1,,,4,,,7
1,,,,,,7
1,,,,,,
,,,4,,,
,,,,,,
so, there is our address data, we can then:
ops$tkyte%ORA10GR2> select x, ','||trim( ',' from replace(replace(x,',,,',','),',,',',') )||','y from t;
X Y
---------------------------------------- --------------------
1,2,3,4,5,6,7 ,1,2,3,4,5,6,7,
1,,3,4,5,6,7 ,1,3,4,5,6,7,
1,,3,,5,6,7 ,1,3,5,6,7,
1,,,,5,6,7 ,1,5,6,7,
1,,,4,,,7 ,1,4,7,
1,,,,,,7 ,1,7,
1,,,,,, ,1,
,,,4,,, ,4,
,,,,,, ,,
9 rows selected.
and now we can:
ops$tkyte%ORA10GR2> select x,
2 trim( substr (txt, instr (txt, ',', 1, 1 ) + 1, instr (txt, ',', 1, 1+1) - instr (txt, ',', 1, 1) -1 ) ) a1,
3 trim( substr (txt, instr (txt, ',', 1, 2 ) + 1, instr (txt, ',', 1, 2+1) - instr (txt, ',', 1, 2) -1 ) ) a2,
4 trim( substr (txt, instr (txt, ',', 1, 3 ) + 1, instr (txt, ',', 1, 3+1) - instr (txt, ',', 1, 3) -1 ) ) a3,
5 trim( substr (txt, instr (txt, ',', 1, 4 ) + 1, instr (txt, ',', 1, 4+1) - instr (txt, ',', 1, 4) -1 ) ) a4,
6 trim( substr (txt, instr (txt, ',', 1, 5 ) + 1, instr (txt, ',', 1, 5+1) - instr (txt, ',', 1, 5) -1 ) ) a5,
7 trim( substr (txt, instr (txt, ',', 1, 6 ) + 1, instr (txt, ',', 1, 6+1) - instr (txt, ',', 1, 6) -1 ) ) a6,
8 trim( substr (txt, instr (txt, ',', 1, 7 ) + 1, instr (txt, ',', 1, 7+1) - instr (txt, ',', 1, 7) -1 ) ) a7
9 from
10 ( select x, ','||trim( ',' from replace(replace(x,',,,',','),',,',',') )||',' txt from t );
X A1 A2 A3 A4 A5 A6 A7
-------------------- ----- ----- ----- ----- ----- ----- -----
1,2,3,4,5,6,7 1 2 3 4 5 6 7
1,,3,4,5,6,7 1 3 4 5 6 7
1,,3,,5,6,7 1 3 5 6 7
1,,,,5,6,7 1 5 6 7
1,,,4,,,7 1 4 7
1,,,,,,7 1 7
1,,,,,, 1
,,,4,,, 4
,,,,,,
9 rows selected.
that is what you load, you load from an external table and using sql get what you need.