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 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
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
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
Mike
The number of sets are dynamic...each set has exactly 10 values all the
time separated by comma
Kalyan kamesh
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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. ...
|
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...
|
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...
|
by: aljaber |
last post by:
hi,
i am facing a problem with my program output
here is the program
/*********************************************\
* CD Database *
* ...
|
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...
|
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....
|
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...
|
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....
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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...
|
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...
| |