login about faq

I have to read a CSV file row by row which is located in the Linux Server.

From the Sample code : http://www.example-code.com/vbdotnet/sftp_readTextFile.asp
I am able to read the file in the SFTP server. In the sample code, they have mentioned the bytes for each row to read.

 '  Open a file for reading.

            handle = sftp.OpenFile(_fileName, "readOnly", "openExisting")
            If (handle = vbNullString) Then
                MsgBox(sftp.LastErrorText)
                Exit Function
            End If

            '  Assume the file we are reading contains the following text:
            '  abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
            '  (in ANSI format -- i.e. one byte per char).

            '  Read 26 bytes:
            Dim sText As String
            sText = sftp.ReadFileText(handle, 26, "ansi")
            If (sText = vbNullString) Then
                MsgBox(sftp.LastErrorText)
                Exit Function
            End If

In my scenario, I have to use End of File. How to alter the code to read end of the line. This will help to solve the issue.

asked Sep 22 '14 at 11:34

chilldll's gravatar image

chilldll
3631015

edited Sep 22 '14 at 12:00

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×201
×43

Asked: Sep 22 '14 at 11:34

Seen: 1,320 times

Last updated: Sep 22 '14 at 12:00

powered by OSQA