#1 (permalink)  
Alt 16.11.2005, 23:44
tmj tmj ist offline
 
Registriert seit: 25.01.2005
Beiträge: 205
Standard

Hallo!

Mein Lieferant bietet eine Preisliste als Textdatei zum Download an. Die erste Zeile beinhaltet die Feldbezeichnungen:

Artikelnummer, Artikelbezeichnung, Artikelgruppe, Artikelgruppe, Artikelgruppe, Artikelgruppe, Artikelgruppe, EAN Nr., Hersteller Kurzname, Artikelkurzbeschreibung, Verf?gbarkeit Text, Verkaufspreis

Wie kann ich diese Zeile so umschreiben, dass daraus die Feldbeschreibungen so aussehen:

v_products_model, v_products_name_2, v_categories_name_1, v_categories_name_2, v_categories_name_3, v_categories_name_4, v_categories_name_5 v_products_ean, v_manufacturers_name, v_products_description_2, v_verfuegbarkeit_2, v_products_price

Kann ich das ungef?hr so l?sen wie es Easypopulate mit EOREOR handhabt?

Wie kann ich definieren, dass v_products_price als letztes Feld erkannt wird und somit EOREOR nicht mehr ben?tigt wird?

Code:
// now we string the entire thing together in case there were carriage returns in the data
	$newreaded = "";
	foreach ($readed as $read){
 $newreaded .= $read;
	}

	// now newreaded has the entire file together without the carriage returns.
	// if for some reason excel put qoutes around our EOREOR, remove them then split into rows
	$newreaded = str_replace('"EOREOR"', 'EOREOR', $newreaded);
	$readed = explode( $separator . 'EOREOR',$newreaded);


	// Now we'll populate the filelayout based on the header row.
	$theheaders_array = explode( $separator, $readed[0] ); // explode the first row, it will be our filelayout
	$lll = 0;
	$filelayout = array();
	foreach( $theheaders_array as $header ){
 $cleanheader = str_replace( '"', '', $header);
	//	echo "Fileheader was $header<br><br><br>";
 $filelayout[ $cleanheader ] = $lll++; //
	}
	unset($readed[0]); // we don't want to process the headers with the data
?ber eure Hilfe w?rde ich mich sehr freuen.

Gr??e tmj
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #2 (permalink)  
Alt 17.11.2005, 11:04
tmj tmj ist offline
 
Registriert seit: 25.01.2005
Beiträge: 205
Standard

Hat jemand eine Idee?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
easypopulate, importfelder, umschreiben

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus



Alle Zeitangaben in WEZ +1. Es ist jetzt 07:26 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand