PC Review


Reply
Thread Tools Rate Thread

Text file Content to byte[]

 
 
=?Utf-8?B?UGFydmV6?=
Guest
Posts: n/a
 
      3rd Apr 2006
BOF
BD|0001|20060403001|1
BO|1|BSE|0001|B|06/B-04130973|77160200000000001|200604031145|2005061|20060403|30/04/2006-03/04/2006|500085|EQT|AR|27.55|3
BT|1|1001|115031|100|29.05
BT|2|1009|115040|100|29.20
BT|3|1011|115044|50|29.25
EOF

This is a prototype that can be in my text file.My web service will have to
read the content of the file and will have to store it in a string[] as given
below
BOF
BD
0001
20060403001
1
BO
Please help me how to do it?
if possible a sample code snippet would help me
Thanks in advance
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QU1lcmNlcg==?=
Guest
Posts: n/a
 
      3rd Apr 2006
> This is a prototype that can be in my text file.My web service will have to
> read the content of the file and will have to store it in a string[] as given below


It sounds to me like you want to split the data into substrings that are
separated by either | or a line break. A line break is most likely vbNewLine
or vbLf. So, load the text file into string s and do operations as follows:

Dim s as string
' load the file into string s
s = Replace(s, vbLf, "|") ' possibly, vbLf should be vbNewLine
Dim a() as string
a = Split(s, "|")

At this point, a() will contain your substrings. It sounds also like you
are using C#, but my code fragment is in basic. Sorry about that. But the
idea is still fairly simple. You want to use Split() to break the text into
tokens based on a separator, and it appears that you have two separators.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Saving double-byte characters as unicode text in a CSV file Michael Bond Microsoft Excel Misc 4 29th Jan 2009 11:01 PM
Best Performance File Compare: MD5/SHA1 or Byte-by-Byte Checking? Mahmoud Al-Qudsi Microsoft C# .NET 6 4th Apr 2007 05:48 PM
How can I read pdf file and save content in text file ? Alex Smith Microsoft ADO .NET 2 15th Jun 2005 05:20 PM
How can I read pdf file and save content in text file ? Alex Smith Microsoft ASP .NET 0 15th Jun 2005 08:05 AM
Double-byte text in CSV file Des Carroll Microsoft Excel Misc 1 2nd Jun 2004 11:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:23 PM.