Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6068
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jerry Stuckle <jstucklex@attglobal.net> |
| Newsgroups | comp.lang.php |
| Subject | Re: reading a newline from a properties file |
| Date | Tue, 15 May 2012 07:49:14 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 71 |
| Message-ID | <jotfru$efj$1@dont-email.me> (permalink) |
| References | <20447277.1852.1336486906498.JavaMail.geo-discussion-forums@ynff7> <12113687.988.1336542193956.JavaMail.geo-discussion-forums@vbpz13> <jod9bh$51c$1@dont-email.me> <jodabf$9in$1@dont-email.me> <32272.1918.1336562506765.JavaMail.geo-discussion-forums@vbq19> <jodv8e$u5u$1@dont-email.me> <26575563.517.1336629363359.JavaMail.geo-discussion-forums@vbxz8> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Tue, 15 May 2012 11:49:18 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="BCas9+v8M45EVU1sn1wIpg"; logging-data="14835"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rElUkR1iYXaovA4kx4gQGKiKjzZMvxu0=" |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
| In-Reply-To | <26575563.517.1336629363359.JavaMail.geo-discussion-forums@vbxz8> |
| Cancel-Lock | sha1:DMB+pB/YX7l8VZXoZfvEolVZNuY= |
| Xref | csiph.com comp.lang.php:6068 |
Show key headers only | View raw
On 5/10/2012 1:56 AM, taltene@gmail.com wrote:
> בתאריך יום רביעי, 9 במאי 2012 17:33:43 UTC+3, מאת Jerry Stuckle:
>> On 5/9/2012 7:21 AM, taltene wrote:
>>> Thanks!
>>> I tried to use your code.
>>> But it still no good for me.
>>> This is the input:
>>>
>>> ------------------------------------------------------------
>>>
>>> _resp_chargingIdx=<?xml version="1.0" encoding="UTF-8"?>
>>> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:al="http://www.alcatel-lucent.com/soap_cm" xmlns:gd="http://www.3gpp.org/ftp/Specs/archive/32_series/32317/schema/32317-700/GenericIRPData" xmlns:bs="http://www.3gpp.org/ftp/Specs/archive/32_series/32607/schema/32607-700/BasicCMIRPSystem" xmlns:bd="http://www.3gpp.org/ftp/Specs/archive/32_series/32607/schema/32607-700/BasicCMIRPData">
>>> .<SOAP-ENV:Body>
>>> ..<bd:createMOResponse>
>>> ...<mO>
>>> ....<moiLocation>imsServiceProfileId=1,suMSubscriptionProfileId=1,suMSubscriberProfileId=+14716000005_at,subscriptionFunctionId=1,managedElementId=HSS1</moiLocation>
>>> ...</mO>
>>> ..</bd:createMOResponse>
>>> .</SOAP-ENV:Body>
>>> </SOAP-ENV:Envelope>
>>>
>>> ------------------------------------------------------------
>>> and this is what print_r($pros) retruns:
>>> ------------------------------------------------------------
>>>
>>> [_resp_chargingIdx] => <?xml version=\"1.0\" encoding=\"UTF-8\"?>
>>> [<SOAP-ENV:Envelope xmlns:SOAP-ENV] => \"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:al=\"http://www.alcatel-lucent.com/soap_cm\" xmlns:gd=\"http://www.3gpp.org/ftp/Specs/archive/32_series/32317/schema/32317-700/GenericIRPData\" xmlns:bs=\"http://www.3gpp.org/ftp/Specs/archive/32_series/32607/schema/32607-700/BasicCMIRPSystem\" xmlns:bd=\"http://www.3gpp.org/ftp/Specs/archive/32_series/32607/schema/32607-700/BasicCMIRPData\">
>>> [....<moiLocation>imsServiceProfileId] => 1,suMSubscriptionProfileId=1,suMSubscriberProfileId=+14716000005_at,subscriptionFunctionId=1,managedElementId=HSS1</moiLocation>
>>> -------------------------------------
>>>
>>> and of course the only key is _resp_chargingIdx...
>>>
>>> any help will be appreciated.
>>> Thanks!!!
>>>
>>
>> There are a number of problems with your code. For instance, if the key
>> you are looking for is "abc=", it will also match on "xyzabc=". Also it
>> could match a value such as "The expression abc=def is bad".
>>
>> I'm still not sure what you're looking for. I tested your function with
>> the input you listed:
>>
>> print_r(ReadValueByKey('properties.txt', '_resp_chargingIdx'));
>>
>> The results:
>>
>> ReadValueByKey
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> which is what I would expect from the given code.
>>
>
> Tannk you Jerry.
> The problem is that the property value is not only
> <?xml version="1.0" encoding="UTF-8"?>
> but it is a multiple line value, and this is what I need to get in return for this function.
Sorry for the late reply; your response just showed up on my news server.
OK, my next question would be then, how is the system supposed to know
where one property stops and the next one starts? I know you only have
one in this file, but what if you had two or three (or more)?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
reading a newline from a properties file taltene@gmail.com - 2012-05-08 07:21 -0700
Re: reading a newline from a properties file The Natural Philosopher <tnp@invalid.invalid> - 2012-05-08 15:42 +0100
Re: reading a newline from a properties file "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-05-08 16:53 +0200
Re: reading a newline from a properties file "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-05-08 18:52 +0200
Re: reading a newline from a properties file Denis McMahon <denismfmcmahon@gmail.com> - 2012-05-08 17:33 +0000
Re: reading a newline from a properties file taltene@gmail.com - 2012-05-08 22:43 -0700
Re: reading a newline from a properties file "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-05-09 09:50 +0200
Re: reading a newline from a properties file "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-05-09 10:20 +0200
Re: reading a newline from a properties file "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-05-09 10:37 +0200
Re: reading a newline from a properties file taltene@gmail.com - 2012-05-09 04:21 -0700
Re: reading a newline from a properties file Jerry Stuckle <jstucklex@attglobal.net> - 2012-05-09 10:33 -0400
Re: reading a newline from a properties file taltene@gmail.com - 2012-05-09 22:56 -0700
Re: reading a newline from a properties file Jerry Stuckle <jstucklex@attglobal.net> - 2012-05-15 07:49 -0400
Re: reading a newline from a properties file Captain Paralytic <paul_lautman@yahoo.com> - 2012-05-09 05:26 -0700
Re: reading a newline from a properties file taltene@gmail.com - 2012-05-09 05:47 -0700
csiph-web