I have a 1200 line text file with information that I need in the following
format.
FIGURE>SAMEFIGURE=NUMBER>SAMENUMBER=CHANNELNAME">S AMECHANNELNAME<DELETE
I want to break it down into this format.
$figure > $figure = $number > $number = $channel ">
$channel < the rest can be deleted
my way (not a lot of experience with this sort of problem..
don't laugh)
explode (">", $exFigure);
$figure = $exFigure[0];
explode ("=", $number);
$figure = $exFigure[1];
// then chop out after the >
And so on..
Would there be a better way I could learn...?
Thanks alot in advance
Mike. 3 2103
Hello Mike,
Try to use regular expressions.
For exmaple:
pref_match ( "/([^>]+)>([^=]+)=(\d+)>(\d+)=([^\"]+)\"/", $exFigure,
$matches );
$matches[1] = FIGURE
$matches[2] = SAMEFIGURE
$matches[3] = NUMBER
$matches[4] = SAMENUMBER
$matches[5] = CHANNELNAME
Excuse my bad pattern, im hurry :)
Dima I have a 1200 line text file with information that I need in the following format. FIGURE>SAMEFIGURE=NUMBER>SAMENUMBER=CHANNELNAME">S AMECHANNELNAME<DELETE
I want to break it down into this format. $figure > $figure = $number > $number = $channel "> $channel < the rest can be deleted my way (not a lot of experience with this sort of problem.. don't laugh)
explode (">", $exFigure); $figure = $exFigure[0];
explode ("=", $number); $figure = $exFigure[1]; // then chop out after the > And so on..
Would there be a better way I could learn...?
Thanks alot in advance
Mike.
On Wed, 8 Oct 2003 16:45:59 -0700, "Michael Willcocks"
<mi*****@metrogroup.com.au> wrote: I have a 1200 line text file with information that I need in the following format. FIGURE>SAMEFIGURE=NUMBER>SAMENUMBER=CHANNELNAME"> SAMECHANNELNAME<DELETE
I want to break it down into this format. $figure > $figure = $number > $number = $channel "> $channel < the rest can be deleted my way (not a lot of experience with this sort of problem.. don't laugh)
explode (">", $exFigure); $figure = $exFigure[0];
explode ("=", $number); $figure = $exFigure[1]; // then chop out after the > And so on..
Would there be a better way I could learn...?
Using explode here sounds quite reasonable; so long as the delimiter is never
part of the data, there's no real need to use anything more complicated.
--
Andy Hassall (an**@andyh.co.uk) icq(5747695) ( http://www.andyh.co.uk)
Space: disk usage analysis tool ( http://www.andyhsoftware.co.uk/space)
Thank you both for your input
Thanks alot seems to be working.
I have never used the pattern method because any time I have seen it in
use... It looks a little scary.
"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:2s********************************@4ax.com... On Wed, 8 Oct 2003 16:45:59 -0700, "Michael Willcocks" <mi*****@metrogroup.com.au> wrote:
I have a 1200 line text file with information that I need in the
followingformat. FIGURE>SAMEFIGURE=NUMBER>SAMENUMBER=CHANNELNAME"> SAMECHANNELNAME<DELETE
I want to break it down into this format. $figure > $figure = $number > $number = $channel "> $channel < the rest can be deleted my way (not a lot of experience with this sort of problem.. don't laugh)
explode (">", $exFigure); $figure = $exFigure[0];
explode ("=", $number); $figure = $exFigure[1]; // then chop out after the > And so on..
Would there be a better way I could learn...? Using explode here sounds quite reasonable; so long as the delimiter is
never part of the data, there's no real need to use anything more complicated.
-- Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Drisco |
last post by:
Hello,
I realy need help,Searched the NG for a days with no vail.
Sorry for the long script.
I am trying to get a variable from php to flash. I have the following
code in php
<a...
|
by: William Stacey [MVP] |
last post by:
Anyone know of some library that will parse files like following:
options {
directory "/etc";
allow-query { any; }; // This is the default
recursion no;
listen-on { 192.168.0.225;...
|
by: Deena |
last post by:
Hi
Windows forms layout is turning to be a nightmare. I add my controls to a
form and then save it and then it just get's all messed up. I'm using
inheritance if this makes any difference. Also...
|
by: Dave |
last post by:
Hello All,
I am having a nightmare trying to add a new row to my
Datagrid. When I use the code below I get the
error: 'Invalid CurrentPageIndex value. It must be >= 0
and < the PageCount. Can...
|
by: Roland Hall |
last post by:
Since I'm not getting any response from the community, I'm reposting this
under my managed account.
I've turned my web.config friendly error messages off and it may be easier
to view what I'm...
|
by: Jim Mirra |
last post by:
Hey,
I have been working on this for a while now and I keep getting the same
error.
here is my code:
------- start code ---------
Dim strSQL = "Select tagid,itemid,description,status,...
|
by: Afshar |
last post by:
Dear nice people around the world!
Please help ending this nightmare,
I have 2 problem with ASP.NET Menu control
First:
I have a horizontal menu at top of my page, each item have some
sub-items...
|
by: Samuel Shulman |
last post by:
I get the following error
Error 2 Could not load file or assembly
'RusticiSoftware.ScormContentPlayer.Logic, Version=2006.1.2576.40320,
Culture=neutral,...
|
by: Bo Yang |
last post by:
Hi, guys. I am now developing an application
in which I need to fetch some html page, and then
parsing it to get some intended content in it.
Because HTML is not a standard XML format, so I
am...
|
by: Andrew Wan |
last post by:
I have been having a nightmare with ASP/ASP.NET & IIS6.
We use Msxml2.DOMDocument.4.0 object to create a XML object in ASP. The
Msxml2.DOMDocument.4.0 is from the Windows Platform SDK Feb 2003...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |