parsing a text file into columns and rows

From: Date: Tue, 12 Jul 2005 16:12:08 +0000
Subject: parsing a text file into columns and rows
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218555@lists.php.net to get a copy of this message
Hi all, i have a text file as shown below, which contains records like varaiable, value pairs seperated by '=' .there are many such records, each record is starts with first variable 'SUBSTRATNAME'. SUBSTRATNAME=S112 <-- PIXEL=5 OPERATOR=Zi KOMMENTAR=dunkel DATUM=03.01.2005 UHRZEIT=11:22 MESSUNG=SWEEP_UI I_SC=-57.3496E-12 V_OC=1.0103E+0 FF=-1.3303E+0 WIRKUNGSGRAD=14.4220E-9 SUBSTRATNAME=E07 <-- PIXEL=1 OPERATOR=MN KOMMENTAR=Au/PEDOTCPP105D/Au DATUM=03.01.2005 UHRZEIT=11:52 MESSUNG=SWEEP_UI I_SC=-50.4506E-12 V_OC=1.0103E+0 FF=-1.5353E+0 WIRKUNGSGRAD=14.6421E-9 SUBSTRATNAME=E07 <-- PIXEL=1 OPERATOR=Zi KOMMENTAR=Au/PEDOTCPP105D/Au DATUM=03.01.2005 UHRZEIT=11:54 MESSUNG=SWEEP_UI I_SC=NaN V_OC=0.0000E+0 FF=NaN WIRKUNGSGRAD=NaN i want to parse this file as shown below each column shud be seperated by tab space or comma. SUBSTRATNAME PIXEL OPERATOR KOMMENTAR...................................WIRKUNGSGRAD s112 5 zi dunkel 14.4220E-9 likes this i want all the values. thanks for help --------------------------------- Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail

« previous php.general (#218555) next »