Click here to Skip to main content
15,884,176 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: OT Pin
Luc Pattyn16-Jun-09 6:16
sitebuilderLuc Pattyn16-Jun-09 6:16 
GeneralRe: OT Pin
ymilan16-Jun-09 6:54
ymilan16-Jun-09 6:54 
GeneralRe: OT Pin
Luc Pattyn16-Jun-09 11:28
sitebuilderLuc Pattyn16-Jun-09 11:28 
GeneralRe: OT Pin
ymilan16-Jun-09 11:30
ymilan16-Jun-09 11:30 
QuestionRead the comma delimited text file. Pin
Member 402761712-Jun-09 4:59
Member 402761712-Jun-09 4:59 
AnswerRe: Read the comma delimited text file. Pin
EliottA12-Jun-09 5:25
EliottA12-Jun-09 5:25 
AnswerRe: Read the comma delimited text file. Pin
Dave Kreskowiak12-Jun-09 5:26
mveDave Kreskowiak12-Jun-09 5:26 
GeneralRe: Read the comma delimited text file. Pin
Member 402761716-Jun-09 21:17
Member 402761716-Jun-09 21:17 
Hi Dave,

I am using this code.

My input is in notepad like below

Input:

IM,ABC001,D,0,@Box1;Images\00\00\ABC001.tif;2
IM,ABC002,,0,@Box1;Images\00\00\ABC002.tif;2
IM,ABC003,D,0,@Box1;Images\00\00\ABC003.tif;2
IM,ABC004,D,0,@Box1;Images\00\00\ABC004.tif;2
IM,ABC005,,0,@Box1;Images\00\00\ABC005.tif;2
IM,ABC006,D,0,@Box1;Images\00\00\ABC006.tif;2

output:

BegBate EndBate
ABC001 ABC002
ABC003 ABC003
ABC004 ABC005
ABC006 ABC006

After use the below code i was got only the BegBate. How I will got the Endbate also like above format?.


MY Code:

Using myreader As New Microsoft.VisualBasic.FileIO.TextFieldParser("c:\ipro.txt")

myreader.TextFieldType = FileIO.FieldType.Delimited

myreader.SetDelimiters(",")

'cr=currentrow
'cf=currentfield

Dim cr As String()
Dim count1 As Integer

While Not myreader.EndOfData
Try
cr = myreader.ReadFields()

For count1 = 4 To cr.Length - 1

If cr(2).Contains("D") Or cr(2).Contains("C") = True Then

Dim sw As StreamWriter

sw = New StreamWriter("c:\test2.txt", True, Encoding.Unicode)

sw.WriteLine(cr(1))

sw.Close()

End If

Next

Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException

MsgBox("Line " & ex.Message & "is not valid and will be skipped.")

End Try

End While

End Using

MsgBox("completed")


Please do the needful

Very Thanks to all,
Please Help..
By
Gopi A.
GeneralRe: Read the comma delimited text file. Pin
Dave Kreskowiak17-Jun-09 1:39
mveDave Kreskowiak17-Jun-09 1:39 
AnswerRe: Read the comma delimited text file. Pin
LloydA11112-Jun-09 9:15
LloydA11112-Jun-09 9:15 
QuestionTrying to acccess sql parameter from dataset Pin
Roger Rainey12-Jun-09 3:56
Roger Rainey12-Jun-09 3:56 
AnswerRe: Trying to acccess sql parameter from dataset Pin
Colin Angus Mackay12-Jun-09 4:28
Colin Angus Mackay12-Jun-09 4:28 
QuestionFolder permissions Pin
vhassan12-Jun-09 1:58
vhassan12-Jun-09 1:58 
AnswerRe: Folder permissions Pin
Dave Kreskowiak12-Jun-09 3:48
mveDave Kreskowiak12-Jun-09 3:48 
AnswerRe: Folder permissions Pin
Nagy Vilmos12-Jun-09 3:59
professionalNagy Vilmos12-Jun-09 3:59 
QuestionDynamic Data Exchange LinkExecute Pin
vhassan11-Jun-09 19:50
vhassan11-Jun-09 19:50 
AnswerRe: Dynamic Data Exchange LinkExecute Pin
Dave Kreskowiak12-Jun-09 3:46
mveDave Kreskowiak12-Jun-09 3:46 
GeneralRe: Dynamic Data Exchange LinkExecute [modified] Pin
vhassan14-Jun-09 18:24
vhassan14-Jun-09 18:24 
GeneralRe: Dynamic Data Exchange LinkExecute Pin
Dave Kreskowiak15-Jun-09 0:49
mveDave Kreskowiak15-Jun-09 0:49 
QuestionHiding the Script Combobox in FONT Dialog Pin
VB 8.011-Jun-09 18:27
VB 8.011-Jun-09 18:27 
AnswerRe: Hiding the Script Combobox in FONT Dialog Pin
LCARS x3211-Jun-09 22:41
LCARS x3211-Jun-09 22:41 
GeneralRe: Hiding the Script Combobox in FONT Dialog Pin
VB 8.011-Jun-09 23:28
VB 8.011-Jun-09 23:28 
Questionchanging cultutre of a datatable Pin
nitin_ion11-Jun-09 17:18
nitin_ion11-Jun-09 17:18 
AnswerRe: changing cultutre of a datatable Pin
Christian Graus11-Jun-09 17:39
protectorChristian Graus11-Jun-09 17:39 
GeneralRe: changing cultutre of a datatable Pin
nitin_ion11-Jun-09 17:43
nitin_ion11-Jun-09 17:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.