0% found this document useful (0 votes)
5 views2 pages

Reading A Delimited File

Delimited files are structured text files organized in rows and columns, with fields separated by a delimiter, typically a comma. They are easy to read and exchange but can pose challenges in parsing and handling special characters. Best practices include using a header for column names and employing a 'TextFieldParser' for reading, while avoiding certain methods like 'StreamRead' and 'ReadLines'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Reading A Delimited File

Delimited files are structured text files organized in rows and columns, with fields separated by a delimiter, typically a comma. They are easy to read and exchange but can pose challenges in parsing and handling special characters. Best practices include using a header for column names and employing a 'TextFieldParser' for reading, while avoiding certain methods like 'StreamRead' and 'ReadLines'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

READING A DELIMITED FILE

A DELIMITED FILE

It is data in a delimited text file arrange in rows and columns, with entry peer row

Each column is separate from the next field by a field separator character/a delimiter(comma)

USEFULNESS OF DELIMITED FILES

1. They are easy to read and write by most programming languages and software application
2. They are good format for exchange data between different applications
3. They are compact format , which makes them easy to store and transmit

DISADVANTAGES

1. They can be difficult to parse , as the delimiter character can also occur within the data itself
2. They can be difficult to handle if the data contains special character , such as comma or tabs
3. They can be difficult to use for data analysing , as they do not provide any structure or
metadata about the data

DO’S

1. Separate data fields with a delimiter usually a comma


2. Keep each record on a separate line
3. Do not follows the last record in a file with a carriage return
4. In the first line of the file , include a header with a list of the column names in the file
5. Make sure the header list is delimited in the same way as the rest of the file
6. Remember that the enclosing character (typically double quotes) must be used when
required
7. Delimited files are read using a “ TextFeildParser”
8. Start a code with a “USING” statement and end with “ END USING”

DON’TS

1. When creating a delimited file , don’t use a “StreamRead”


2. Don’t use” ReadLines”

DO’S WHEN PROGRAMMING

1. Start your code with “USING” statement


2. Use a “ TextFeildParser” to read a file
3. The “ TextFeildParser” property defines whether it is a delimited file or one with fixed-width
field of text

You might also like