Hi Atli.
thanks for ur co operation.if u please send me smple code for insert data from text file to related fileds in a table of oracle db.Then it will be easy for me to understand.
i have tried a simple code that is :problem is it doesnt insert morethan 1 row.i want to insert every row in db.
-
$file = fopen("raw_data_31_03.txt","rb");
-
-
while(! feof($file))
-
{
-
//echo fgets($file). "<br />";
-
$first=trim($first.fgets($file));
-
//echo $first;
-
}
-
$first1= substr($first,0,8);
-
//$filewr = fwrite(fopen($first1,"r+"),$tonek,280);
-
//mysql_query("insert into test(name) values($first1)");
-
echo $first1;
-
$file1 = fopen("raw_data_31_03.txt","rb");
-
while(! feof($file1))
-
{
-
//echo fgets($file). "<br />";
-
$second=trim($second.fgets($file1));
-
//echo $first;
-
}
-
$second1= substr($second,9,7);
-
//mysql_query("insert into test(name1) values($second1)");
-
echo $second1;
-
-
while(! feof($file2))
-
{
-
$third=trim($third.fgets($file2));
-
}
-
$third1 = substr($third,16,6);
-
mysql_query("insert into test(name2) values($third1)");
-
-
echo $third1;
-
-
-
fclose($file);
-
fclose($file1);
-
fclose($file2);
-
-
?>
Text file that i want to insert:
03/31/02 04:21PM 136 11 9564499- 00:00'54 TR
03/31/03 04:22PM 202 10 9338340 00:00'00
03/31/04 04:22PM 202 10 8916116 00:00'05
03/31/05 04:23PM 142 06 <I> 0'00 00:00'31 TR
03/31/06 04:23PM 125 08 108 00:00'32
03/31/07 07:51AM 13 <I> 0'05 NA
03/31/08 04:23PM 180 05 9561760 00:03'45 TR
03/31/09 04:24PM 125 04 8126666 00:00'11
03/31/11 04:24PM 201 10 018222255 00:00'12
03/31/22 07:57AM 13 <I> 0'05 NA
03/31/33 04:24PM 202 07 <I> 0'07 00:01'42
03/31/44 04:24PM 201 10 018222255 00:00'02