Vb read and convert ran text

2010-03-24 1:37 am
nnn.RAN
The name of the file is a random
combination of numbers and letters
followed by a .RAN file extension.
Each piece of data in this file is delimited
by a either a comma, colon or semi colon character
Example text file for this (rantext.ran):
Olga Harris,2938470:13.0:8:9
Ted Bear :3920118,7,8,10

how to read the text from this Textfile and write to other textfile(FinalFile.text) that follow the format below:
1. Each string must be surrounded by double quotes.
Each piece of data must be delimited by a Tab
Each person's data must be stored an a new line

2. The data to be stored is:
Person ID
Person Name
Total Score (addition of all three scores for the person)

example for this:
"2938470" "Olga Harris" "30.0"
"3920118" "Ted Bear" "25.0"

回答 (1)

2010-03-24 4:09 pm
✔ 最佳答案
The codes are the same as those I showed you in
http://hk.knowledge.yahoo.com/question/question?qid=7010032201475
with only one change

Change
Dim s() As String = {","} '
comma as separator
to
Dim s() As String = {",", ":", ";"} ' separators

The data in each line will be split by the separators


收錄日期: 2021-04-26 13:12:23
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20100323000051KK01041

檢視 Wayback Machine 備份