SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Aug 25, 2009, 10:54 #1
- Join Date
- Aug 2009
- Posts
- 14
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Convert one text structure into another
Hi,
I'm trying to convert this text structure:
PHP Code:COLA COLB COLC COLD
01.00000 02.00000 03.00000 04.00000
05.00000 06.00000 07.00000 08.00000
09.00000 10.00000 11.00000 12.00000
13.00000 14.00000 15.00000 16.00000
PHP Code:"comp" 4
01.00000 ;COLA
02.00000 ;COLB
03.00000 ;COLC
04.00000 ;COLD
"comp" 4
05.00000 ;COLA
06.00000 ;COLB
07.00000 ;COLC
08.00000 ;COLD
"comp" 4
09.00000 ;COLA
10.00000 ;COLB
11.00000 ;COLC
12.00000 ;COLD
"comp" 4
13.00000 ;COLA
14.00000 ;COLB
15.00000 ;COLC
16.00000 ;COLD
How to do that?
Thanks in advance,
minopharma
-
Sep 1, 2009, 11:26 #2
- Join Date
- Nov 2006
- Location
- UK
- Posts
- 2,559
- Mentioned
- 40 Post(s)
- Tagged
- 1 Thread(s)
AS2
Use String.split and Array.join to replace newlines and spaces
AS3
Use String.replace / RegExp class.
Bookmarks