473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

output format

Hi

I got a string as follows

str=
-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685
i need a code in asp so the output is in the following format
-0.1400,0.0834,0.0711#0.2910,-0.4026,-0.1743#-0.2742,-0.2563,-0.0128#-0.2904,-0.0145,0.0122#0.1087,-0.3120,-0.1154#0.0323,-0.2324,-0.1392#-0.1355,-0.1320,-0.1910#
-0.1221,-0.0246,0.0543#-0.2164,-0.1383,-0.0450#-0.2128,-0.1964,-0.0685
please help

Regards
kalyan kamesh

Mar 29 '06 #1
6 1339

ka*****@gmail.com wrote:
Hi

I got a string as follows

str=
-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685
i need a code in asp so the output is in the following format
-0.1400,0.0834,0.0711#0.2910,-0.4026,-0.1743#-0.2742,-0.2563,-0.0128#-0.2904,-0.0145,0.0122#0.1087,-0.3120,-0.1154#0.0323,-0.2324,-0.1392#-0.1355,-0.1320,-0.1910#
-0.1221,-0.0246,0.0543#-0.2164,-0.1383,-0.0450#-0.2128,-0.1964,-0.0685
please help

Regards
kalyan kamesh


Here you go:

<%
str =
"-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685"

splitstr = split(str,"#")

firstarr = split(splitstr(0),",")
secondarr = split(splitstr(1),",")
thirdarr = split(splitstr(2),",")
newstr = ""
for i = 0 to ubound(firstarr)
newstr = newstr & firstarr(i) & "," & secondarr(i) & "," & thirdarr(i)
& "#"
next
response.write left(newstr,len(newstr)-1)
%>

--
Mike Brind

Mar 29 '06 #2
Mike Brind wrote:
ka*****@gmail.com wrote:
Hi

I got a string as follows

str=
-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685
i need a code in asp so the output is in the following format
-0.1400,0.0834,0.0711#0.2910,-0.4026,-0.1743#-0.2742,-0.2563,-0.0128#-0.2904,-0.0145,0.0122#0.1087,-0.3120,-0.1154#0.0323,-0.2324,-0.1392#-0.1355,-0.1320,-0.1910#
-0.1221,-0.0246,0.0543#-0.2164,-0.1383,-0.0450#-0.2128,-0.1964,-0.0685
please help

Regards
kalyan kamesh


Here you go:

<%
str =
"-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685"

splitstr = split(str,"#")

firstarr = split(splitstr(0),",")
secondarr = split(splitstr(1),",")
thirdarr = split(splitstr(2),",")
newstr = ""
for i = 0 to ubound(firstarr)
newstr = newstr & firstarr(i) & "," & secondarr(i) & "," & thirdarr(i)
& "#"
next
response.write left(newstr,len(newstr)-1)
%>

--
Mike Brind

Hi Mike

Thanks for response
but my series in str is dynamic...what should i do in that case

Regards
kalyan

Mar 29 '06 #3

kali...@gmail.com wrote:
Mike Brind wrote:
ka*****@gmail.com wrote:
Hi

I got a string as follows

str=
-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685
i need a code in asp so the output is in the following format
-0.1400,0.0834,0.0711#0.2910,-0.4026,-0.1743#-0.2742,-0.2563,-0.0128#-0.2904,-0.0145,0.0122#0.1087,-0.3120,-0.1154#0.0323,-0.2324,-0.1392#-0.1355,-0.1320,-0.1910#
-0.1221,-0.0246,0.0543#-0.2164,-0.1383,-0.0450#-0.2128,-0.1964,-0.0685
please help

Regards
kalyan kamesh


Here you go:

<%
str =
"-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685"

splitstr = split(str,"#")

firstarr = split(splitstr(0),",")
secondarr = split(splitstr(1),",")
thirdarr = split(splitstr(2),",")
newstr = ""
for i = 0 to ubound(firstarr)
newstr = newstr & firstarr(i) & "," & secondarr(i) & "," & thirdarr(i)
& "#"
next
response.write left(newstr,len(newstr)-1)
%>

--
Mike Brind

Hi Mike

Thanks for response
but my series in str is dynamic...what should i do in that case

Regards
kalyan


The example you gave shows three sets of 10 values delimited by #.
Each of the values within each set is delimited by a comma. Which
part(s) are dynamic? The number of sets? The number of values? Are
the number of values always the same regardless of the number of sets?
Will the number of values change between sets?

--
Mike Brind

Mar 29 '06 #4
Mike

The number of sets are dynamic...each set has exactly 10 values all the
time separated by comma

Kalyan kamesh

Mar 29 '06 #5
kali...@gmail.com wrote:
Mike Brind wrote:
kali...@gmail.com wrote:
Hi I got a string as follows str=
-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685 i need a code in asp so the output is in the following format -0.1400,0.0834,0.0711#0.2910,-0.4026,-0.1743#-0.2742,-0.2563,-0.0128#-0.2904,-0.0145,0.0122#0.1087,-0.3120,-0.1154#0.0323,-0.2324,-0.1392#-0.1355,-0.1320,-0.1910#
-0.1221,-0.0246,0.0543#-0.2164,-0.1383,-0.0450#-0.2128,-0.1964,-0.0685 please help Regards
kalyan kamesh
Here you go: <%
str =
"-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685" splitstr = split(str,"#") firstarr = split(splitstr(0),",")
secondarr = split(splitstr(1),",")
thirdarr = split(splitstr(2),",")
newstr = ""
for i = 0 to ubound(firstarr)
newstr = newstr & firstarr(i) & "," & secondarr(i) & "," & thirdarr(i)
& "#"
next
response.write left(newstr,len(newstr)-1)
%> --
Mike Brind
Hi Mike Thanks for response
but my series in str is dynamic...what should i do in that case Regards
kalyan The example you gave shows three sets of 10 values delimited by #.
Each of the values within each set is delimited by a comma. Which
part(s) are dynamic? The number of sets? The number of values? Are
the number of values always the same regardless of the number of sets?
Will the number of values change between sets? --
Mike Brind
ka*****@gmail.com wrote:
Mike

The number of sets are dynamic...each set has exactly 10 values all the
time separated by comma

Kalyan kamesh


First off, please don't use the reply link at the bottom of the post in
google groups - it wipes out what you are replying to. Use the Reply
link that is revealed when you click Show Options next to a poster's
name. Loads of poster's get caught out with that. Google really ought
to sort their interface out :-)

Back to your question - you need to read them into a 2 d array, then
read then back out in the order that you want. This should do it:

splitstr = split(str,"#")
cols=9
rows=ubound(splitstr)

dim myarray()
redim myarray(cols,rows)

for y = 0 to rows
arr = split(splitstr(y),",")
for x = 0 to cols
myarray(x,y) = arr(x)
next
next
newstr = ""
for i = 0 to cols
for j = 0 to rows
newstr = newstr & myarray(i,j)
if j = rows then
newstr=newstr
else
newstr = newstr & ","
end if
next
newstr = newstr & "#"
next
response.write left(newstr,len(newstr)-1)
%>

--
Mike Brind

Mar 30 '06 #6

Mike Brind wrote:
kali...@gmail.com wrote:
Mike Brind wrote:
kali...@gmail.com wrote:
> Hi I got a string as follows str=
> -0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685 i need a code in asp so the output is in the following format -0.1400,0.0834,0.0711#0.2910,-0.4026,-0.1743#-0.2742,-0.2563,-0.0128#-0.2904,-0.0145,0.0122#0.1087,-0.3120,-0.1154#0.0323,-0.2324,-0.1392#-0.1355,-0.1320,-0.1910#
> -0.1221,-0.0246,0.0543#-0.2164,-0.1383,-0.0450#-0.2128,-0.1964,-0.0685 please help Regards
> kalyan kamesh Here you go: <%
str =
"-0.1400,0.2910,-0.2742,-0.2904,0.1087,0.0323,-0.1355,-0.1221,-0.2164,-0.2128#0.0834,-0.4026,-0.2563,-0.0145,-0.3120,-0.2324,-0.1320,-0.0246,-0.1383,-0.1964#0.0711,-0.1743,-0.0128,0.0122,-0.1154,-0.1392,-0.1910,0.0543,-0.0450,-0.0685" splitstr = split(str,"#") firstarr = split(splitstr(0),",")
secondarr = split(splitstr(1),",")
thirdarr = split(splitstr(2),",")
newstr = ""
for i = 0 to ubound(firstarr)
newstr = newstr & firstarr(i) & "," & secondarr(i) & "," & thirdarr(i)
& "#"
next
response.write left(newstr,len(newstr)-1)
%> --
Mike Brind

Hi Mike

Thanks for response
but my series in str is dynamic...what should i do in that case

Regards
kalyan

The example you gave shows three sets of 10 values delimited by #.
Each of the values within each set is delimited by a comma. Which
part(s) are dynamic? The number of sets? The number of values? Are
the number of values always the same regardless of the number of sets?
Will the number of values change between sets?

--
Mike Brind
ka*****@gmail.com wrote:
Mike

The number of sets are dynamic...each set has exactly 10 values all the
time separated by comma

Kalyan kamesh


First off, please don't use the reply link at the bottom of the post in
google groups - it wipes out what you are replying to. Use the Reply
link that is revealed when you click Show Options next to a poster's
name. Loads of poster's get caught out with that. Google really ought
to sort their interface out :-)

Back to your question - you need to read them into a 2 d array, then
read then back out in the order that you want. This should do it:

splitstr = split(str,"#")
cols=9
rows=ubound(splitstr)

dim myarray()
redim myarray(cols,rows)

for y = 0 to rows
arr = split(splitstr(y),",")
for x = 0 to cols
myarray(x,y) = arr(x)
next
next
newstr = ""
for i = 0 to cols
for j = 0 to rows
newstr = newstr & myarray(i,j)
if j = rows then
newstr=newstr
else
newstr = newstr & ","
end if
next
newstr = newstr & "#"
next
response.write left(newstr,len(newstr)-1)
%>

--
Mike Brind

Thanks Mike it worked great...thanks for u r reply

Thanks & Regards
kalyan kamesh

Mar 31 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sebastien de Menten | last post by:
Hi, I am using the profile module to watch hot spots in a python application. The default output is already useful but has anyone tried to produce output readable by kcachegrind...
4
by: newbiecpp | last post by:
How can I format output string. For example, when I use: Console.WriteLine("12345") I want to output like " 12345", i.e., I need set width is 10 and align at right. How can I do it. ...
32
by: spibou | last post by:
Is the output of the C preprocessor deterministic ? What I mean by that is , given 2 compilers which conform to the same standard, will their preprocessors produce identical output given as input...
1
by: nriley | last post by:
Hi, I've got a number of doctests which rely on a certain output format, and since I wrote the tests I've changed the output format. Now, almost all the tests fail. What I'd like is if I...
11
by: aljaber | last post by:
hi, i am facing a problem with my program output here is the program /*********************************************\ * CD Database * * ...
0
by: surya926 | last post by:
Hello I am loading one input xml file and after manipulating the xml file the data should update in that xml file and returns the updated xml file as a output. Here my problem is i am using...
2
by: johnperl | last post by:
i am working on the script as below, i want an output according to the format. i am trying to put everything in one loop but cannot figure out the way to do so. could anyone please help me with this....
1
by: CAM123 | last post by:
I have added: <br><xsl:value-of select="Line" /></br> to my XSLT stylesheet to get a line per repeating block. When I view the output as XML it looks perfect - one line per block. However...
5
by: amit.uttam | last post by:
Hey everyone, I've recently jumped big time into python and I'm working on a software program for testing automation. I had a question about proper logging of output. What I would like is: 1....
8
by: victor.herasme | last post by:
Hi, i am building a little script and i want to output a series of columns more or less like this: 1 5 6 2 2 8 2 9 5 The matter is that i don't know in advance how many columns...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.