| View previous topic :: View next topic |
| Author |
Message |
alpizzle
Joined: 08 Apr 2008 Posts: 3
|
Posted: Wed Apr 23, 2008 12:35 pm Post subject: StreamWriter Writeline in Asp.Net |
|
|
Hi everyone. I am using a streamwriter in asp.net to write the contents of a tex file into a new text file. I am having trouble getting the irght results though. Here is the line I am trying to copy:
"Label"="Shelf 3 D/A B"
I need to copy the "Shelf 3 D/A B" from that line, without the quotation marks. The format for the entire file is like this, so I can say start copying at the 10th position for example. But nothing I try is working. I have
| Code: |
| writer.WriteLine(phNumber & " " & (strLine1)) |
which copies the whole line. but I need everything from the ""S" to the end of the line -1 or - the "
Any help would be appreciated greatly.
Thanks |
|
| Back to top |
|
 |
|
|
alpizzle
Joined: 08 Apr 2008 Posts: 3
|
Posted: Wed Apr 23, 2008 12:55 pm Post subject: Re: StreamWriter Writeline in Asp.Net |
|
|
Okay I am closer, just need a little help in the rest current code I have is
| Code: |
| writer.WriteLine(phNumber & " " & strLine1.Substring(strLine1.IndexOf(" ") + 1, strLine1.Length - strLine1.IndexOf(" ") - 2)) |
Which produces :
158 3 D/A B
This is desired except that it cuts off the first word, in this case "Shelf" If I try to add anything other than a " " to indexof at the beginning I get errors. |
|
| Back to top |
|
 |
|