Link to home
Start Free TrialLog in
Avatar of fabiano petrone
fabiano petroneFlag for Italy

asked on

perl script for processing some txt data

hello,
I've a txt file with some (1158 records) registry data on the form:
object(stdClass)#2 (1) { 
	["GetAnagraficheOrdineResult"]=> object(stdClass)#3 (1) { 
		["DtoAnagraficaDataWeb"]=> array(1159) { 
			[0]=> object(stdClass)#4 (81) { 
				ARRAY_MEMBERS
				}
			[1]=> object(stdClass)#5 (81) { 
				ARRAY_MEMBERS
				}
			......
			[1158]=> object(stdClass)#1162 (81) {
			ARRAY_MEMBERS
			}
		}
 
	}
}

Open in new window


Where ARRAY_MEMBERS has the structure:
["Field_description"]=> field_type "field_value"

Open in new window

i.e.
["ProfNome"]=> string(9) "John"
["ProfCognome"]=> string(5) "Doe"
["ProfLegalMail"]=> string(32) "john.doe@mail.com"

Open in new window

...etc...

I'd like to have a perl script that -once launched from the console- loops over all the 1158 records and construct 1158 lines contained ONLY the field_value of some selected field_descriptions "comma separated", i.e.
('Doe', 'John');

Open in new window


Thanks,
Fabiano
Avatar of Dave Cross
Dave Cross
Flag of United Kingdom of Great Britain and Northern Ireland image

What have you tried? What problems are you having? Please show us your code.
Avatar of fabiano petrone

ASKER

Hi,
Forget to say that I'm a really newbie, usually I work on hardware.
I've made some siiimple thing in Perl years ago: nothing more.
Sorry no code for this single problem: can you help me anyway?
Thanks,
Fabiano
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks noci
I've build the stuff around your suggestion and it works OK
Avatar of noci
noci

np.