Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > output format

Reply
Thread Tools

output format

 
 
kalikoi@gmail.com
Guest
Posts: n/a
 
      03-29-2006
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

 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      03-29-2006

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

 
Reply With Quote
 
 
 
 
kalikoi@gmail.com
Guest
Posts: n/a
 
      03-29-2006
Mike Brind wrote:
> 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

 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      03-29-2006

kali...@gmail.com wrote:
> Mike Brind wrote:
> > 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

 
Reply With Quote
 
kalikoi@gmail.com
Guest
Posts: n/a
 
      03-29-2006
Mike

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

Kalyan kamesh

 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      03-30-2006
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
> 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

 
Reply With Quote
 
kalikoi@gmail.com
Guest
Posts: n/a
 
      03-31-2006

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
> > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want help on how we convert output to tabular format Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format. sharan XML 1 10-26-2007 01:20 PM
parse output screen ok but cant get desired output new file! chuck amadi Python 1 06-23-2004 02:16 PM
Sony Precision Cinema Progressive Output vs Component 480p Output Otto Pylot DVD Video 1 04-18-2004 09:49 PM
Is Fuji S3000 3.2m/pixel output, or 6 m/pixel interpolated output? Peter H Digital Photography 43 12-04-2003 02:35 PM
Output / Debug window output bug? John Bentley ASP .Net 0 09-10-2003 07:38 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57