computer






 

Question by  greathearts (23)

What are some basic tips on reading comma delimited file's in visual basic?

 
+5

Answer by  PeteGreen (62)

The best strategy would be to scan through the file to be parsed using a two nested while loops, storing the values in an array. The inner loops would store characters until a comma, the outer would go to a new row on a line break.

 
+5

Answer by  Naturecoder (5)

First, read in the file (an easy way to do this is with puter.FileSystem.ReadAllText). After this, split the file by calling the split function, passing the delimiting character (the comma) (myString.Split(",")). You then have to remove the comma from all strings in the array except for the first, which you can do with a for loop and substrings.

 
+5

Answer by  gigo (1706)

First of all you need a File System Object. This object normally has a function ReadTextFile. You have to call it with the file name and the Read / Write attributes. After that you have to read the file line by line in a loop. This loop has to have a inner loop to tokenize. Use the Mid function.

 
+5

Answer by  willynel (57)

You will need to use the Microsoft.VisualBasic.FileIO.TextFieldParser object. Once you put this in the next step will be to declare the FileIO.FieldType to Delimited. After that, you will have to set the type of delimiter to comma, like this: (","). Wrap this into a Do While Loop and test.

 
+5

Answer by  stephenk2010 (293)

Files in. csv format, you can read them with a text editor, such as Wordpad or Notepad, or you can also read them in Excel. In the case of Excel 2007, click "File", "Open". In the resulting dialog select "All Files" in the dropdown menu, then navigate to the. csv.

 
+4

Answer by  charu (23)

This file is commonly provided one.It provides various functions and methods allowing programmers to build this application comma is used separate each element of a file.Each will emphasize a different technology to manage ma delimited files are text files which data is stored separated by commas.Visual basic can be used to open and read a file.

 
+4

Answer by  gigo (1706)

An easy way is to use mySQL and ODBC. Instead of a mySQL databasefile you can choose csv files as well.

 
+4

Answer by  swamisarge (283)

Open the file, read and transfer a character at a time to a variant defined variable, until a comma is read. Process the contents of the variable and repeat.

 
You have 50 words left!