Merge superfluous files
This commit is contained in:
parent
adf447fe1a
commit
cc178c4a0d
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
|||
/values/langfiles
|
||||
*.swp
|
||||
*.swo
|
||||
commonservices
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
ob_start();
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg //////////////////////
|
||||
require 'inc/zeichen.php';
|
||||
$filename = $_GET['fnam'];
|
||||
$csv_datei = 'csv/' . $filename;
|
||||
|
||||
if (!file_exists("xml")) {
|
||||
mkdir("xml", 0700);
|
||||
}
|
||||
|
||||
$fp = fopen ( $csv_datei, 'r' );
|
||||
$y = 0;
|
||||
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
|
||||
{
|
||||
$y++;
|
||||
//echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>';
|
||||
$zieldatei = 'xml/' . $y . '.xml';
|
||||
if (!$handle = fopen($zieldatei, 'w')) {
|
||||
echo "Cannot open file ($zieldatei)";exit;
|
||||
}
|
||||
$somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
|
||||
/*$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal */
|
||||
$somecontent = $somecontent . '<record>' . "\n";
|
||||
|
||||
for ($x = 0; $x < count ( $zeile ); $x++)
|
||||
{
|
||||
$inhalt[$y][$x] = $zeile[$x];
|
||||
//echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>';
|
||||
if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ';
|
||||
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8
|
||||
$somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg //////////////////////////////////////////////////////////////
|
||||
|
||||
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung
|
||||
}
|
||||
$somecontent = $somecontent . '</record>';
|
||||
//if ($y>1)
|
||||
//{
|
||||
if (fwrite($handle, $somecontent) === FALSE) {
|
||||
echo "Cannot write to file ($filename)";exit;
|
||||
}
|
||||
// echo "Success, wrote to file ($filename)<br><br>";
|
||||
//}
|
||||
fclose($handle);
|
||||
}
|
||||
fclose($fp);
|
||||
echo ($y - 1) . ' files created';
|
||||
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
|
|
@ -1,39 +1 @@
|
|||
<?PHP
|
||||
//error_reporting(E_ALL);
|
||||
//ini_set('display_errors',1);
|
||||
ob_start();
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg //////////////////////
|
||||
require 'inc/zeichen.php';
|
||||
$filename = $_GET['fnam'];
|
||||
$csv_datei = 'csv/' . $filename;
|
||||
|
||||
mkdir("xml", 0777);
|
||||
$fp = fopen ( $csv_datei, 'r' );
|
||||
$y = 0;
|
||||
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
|
||||
{
|
||||
$y++;
|
||||
$zieldatei = 'xml/' . $y . '.xml';
|
||||
if (!$handle = fopen($zieldatei, 'w')) {
|
||||
echo "Cannot open file ($zieldatei)";exit;
|
||||
}
|
||||
$somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
|
||||
$somecontent = $somecontent . '<record>' . "\n";
|
||||
|
||||
for ($x = 0; $x < count ( $zeile ); $x++)
|
||||
{
|
||||
$inhalt[$y][$x] = $zeile[$x];
|
||||
$inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]);
|
||||
$inhalt[$y][$x] = str_replace('>', ']', str_replace('<', '[', $inhalt[$y][$x]));
|
||||
//if ($y!=1) $inhalt[$y][$x] = '<![CDATA['.$inhalt[$y][$x].']]>';
|
||||
$somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg }
|
||||
}
|
||||
$somecontent = $somecontent . '</record>';
|
||||
if (fwrite($handle, $somecontent) === FALSE) {
|
||||
echo "Cannot write to file ($filename)";exit;
|
||||
}
|
||||
fclose($handle);
|
||||
}
|
||||
fclose($fp);
|
||||
echo ($y - 1) . ' files created';
|
||||
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
|
||||
|
|
43
index4.php
43
index4.php
|
@ -9,10 +9,45 @@ echo '</div>';
|
|||
echo '<div class="maincontent">';
|
||||
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">';
|
||||
echo '<tr>';
|
||||
echo '<td width="50%">';
|
||||
echo 'Please wait ... (transforming)<hr>';
|
||||
require 'csv_laden_utf.php';
|
||||
echo '</td>';
|
||||
echo '<td width="50%">';
|
||||
echo 'Please wait ... (transforming)<hr>';
|
||||
ob_start();
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg //////////////////////
|
||||
require 'inc/zeichen.php';
|
||||
$filename = $_GET['fnam'];
|
||||
$csv_datei = 'csv/' . $filename;
|
||||
|
||||
mkdir("xml", 0777);
|
||||
$fp = fopen ( $csv_datei, 'r' );
|
||||
$y = 0;
|
||||
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
|
||||
{
|
||||
$y++;
|
||||
$zieldatei = 'xml/' . $y . '.xml';
|
||||
if (!$handle = fopen($zieldatei, 'w')) {
|
||||
echo "Cannot open file ($zieldatei)";exit;
|
||||
}
|
||||
$somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
|
||||
$somecontent = $somecontent . '<record>' . "\n";
|
||||
|
||||
for ($x = 0; $x < count ( $zeile ); $x++)
|
||||
{
|
||||
$inhalt[$y][$x] = $zeile[$x];
|
||||
$inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]);
|
||||
$inhalt[$y][$x] = str_replace('>', ']', str_replace('<', '[', $inhalt[$y][$x]));
|
||||
//if ($y!=1) $inhalt[$y][$x] = '<![CDATA['.$inhalt[$y][$x].']]>';
|
||||
$somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg }
|
||||
}
|
||||
$somecontent = $somecontent . '</record>';
|
||||
if (fwrite($handle, $somecontent) === FALSE) {
|
||||
echo "Cannot write to file ($filename)";exit;
|
||||
}
|
||||
fclose($handle);
|
||||
}
|
||||
fclose($fp);
|
||||
echo ($y - 1) . ' files created';
|
||||
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
|
50
index6.php
50
index6.php
|
@ -9,8 +9,54 @@ echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">
|
|||
echo '<tr>';
|
||||
echo '<td width="50%">';
|
||||
echo 'Please wait ... (transforming)<hr>';
|
||||
require 'csv_laden_hu.php';
|
||||
|
||||
require 'inc/zeichen.php';
|
||||
$filename = $_GET['fnam'];
|
||||
$csv_datei = 'csv/' . $filename;
|
||||
|
||||
if (!file_exists("xml")) {
|
||||
mkdir("xml", 0700);
|
||||
}
|
||||
|
||||
$fp = fopen ( $csv_datei, 'r' );
|
||||
$y = 0;
|
||||
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
|
||||
{
|
||||
$y++;
|
||||
//echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>';
|
||||
$zieldatei = 'xml/' . $y . '.xml';
|
||||
if (!$handle = fopen($zieldatei, 'w')) {
|
||||
echo "Cannot open file ($zieldatei)";exit;
|
||||
}
|
||||
$somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
|
||||
/*$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal */
|
||||
$somecontent = $somecontent . '<record>' . "\n";
|
||||
|
||||
for ($x = 0; $x < count ( $zeile ); $x++)
|
||||
{
|
||||
$inhalt[$y][$x] = $zeile[$x];
|
||||
//echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>';
|
||||
if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ';
|
||||
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8
|
||||
$somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg //////////////////////////////////////////////////////////////
|
||||
|
||||
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung
|
||||
}
|
||||
$somecontent = $somecontent . '</record>';
|
||||
//if ($y>1)
|
||||
//{
|
||||
if (fwrite($handle, $somecontent) === FALSE) {
|
||||
echo "Cannot write to file ($filename)";exit;
|
||||
}
|
||||
// echo "Success, wrote to file ($filename)<br><br>";
|
||||
//}
|
||||
fclose($handle);
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
echo ($y - 1) . ' files created';
|
||||
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
|
Loading…
Reference in New Issue
Block a user