o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Problem importing delimiter text file -

Hello and happy new year.

I have a problem in reading a text file in VB 2005. What I want to do is to read a text file which contains delimited. eg.

AA, date, value, color

1;10/10/2007;11552;blue;

2;15/12/2007;15222;red;

I want the text file to imported in a winform in datagrid to make changes in it and reexport it in a text file with the same format.

Can you please help me on this;

This is what I have done but is not working:




Code:
Private Function Analyze(ByVal strFileName As String) As ArrayList

Dim strText As FileIO.TextFieldParser

strText.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited

Dim fi As FileInfo

Dim sr As StreamReader = sr

Dim intRow As Integer

Dim al As New ArrayList()

Dim tl As TextLine

fi = New FileInfo(strFileName)

sr = fi.OpenText()

strText.Delimiters = New String() {";"}



Do

strText.Delimiters = sr.ReadLine()

If Not (strText Is Nothing) Then

tl = New TextLine(strText.ToString, intRow)

al.Add(tl)

End If

intRow += 1

Loop Until (strText Is Nothing)

sr.Close()

If Not (sr Is Nothing) Then

sr.Close()

End If

Return al

End Function

End Class
Thanks in advance.

 

TransferText Problem -
Dear Friends, I wish to ask: Does MS Access 97 support the use of a Schema.ini file to be the specificationname for importing from a text file using the command: DoCmd.TransferText [transfertype][, specificationname], tablename, filename[, hasfieldnames][, HTMLtablename] I wish t


MS Access 97 and Schema.ini file -
Dear Friends, I wish to ask: Does MS Access 97 support the use of a Schema.ini file to be the specificationname for importing from a text file using the command: DoCmd.TransferText [transfertype][, specificationname], tablename, filename[, hasfieldnames][, HTMLtablename] I wi


Reading Tab Delimited File Using 'Input' Function -
Using VB6 Pro. I am importing data to an Access database from a text file. How do I skip the first 4 or so lines (File Header)?. Also using the 'Split' function to split each line into fields so I can add to appropriate field in Access table. eg Split(expression[, delimiter[, c


import a text file -
Code for importing a text file database with space as delimiter to a SQL 7.0 table.


create a csv file from a macro with different delimiter -
Hi all i've create a csv file from a macro after i changed my delimiter to semi-colon. when i try to reopen the file with notepad i find that the used delimiter is a comma and not the one i specified in my regional settings. Is there any command that i can use in the macro to specify


[Excel 2007]- Split Function with Tab as delimiter doesn't work -
Hi, I am currently developing a program in Office Excel 2007 (OS XP 2002 SP2) that open a .txt file with Tab delimited data and parse it into different worksheets in Excel. I use the Split Function to parse the txt file, line by line. But the problem is the Split Function doesn't wo


Convert excel to Text file with Pipe delimiter -
Hi Gurus, I want to know how can I save a Excel file with | delimiter using VB. Now I'm able to save the Excel file to Text file but it is saving with Tab delimiter. But I want |(pipe) Instead of Tab. Appreciate your resposne. Best, AM


Problem with importing TxtFile to Access Table -
Hello All.... Pls Help me!!!!! I'm importing a txtfile into an Access Table.The field delimiter that is provided is "/" character.The record separator is enter character(line feed). The problem is that one of the field may contain an enter character(line feed).ie an Add


importing an other php file -
I have a php page and I am importing an other one. In the start of the first php file I am opening up the DB and all that, furuther down in that PHP file I am importing the the other one. Do I still have to open the DB in that file too? ØØ


How to change Excel standard delimiter for .csv files -
Hello, I have noticed that the only way you can force Excel to open a .CSV file formatting the colums and rows according to the original scheme is by using the semicolon as a delimiter. If you use a comma as a delimiter, Excel will include all the fields in one cell. Now, since m


Tab Delimiter -
Greetings everyonel! I lurk around here from time to time, but now I have a question. I need to work with a tab-delimited file, but I dont know how to declare the Delimiter as a tab. I know how to work with comma delimiters and such, so I just need to know how to declare a tab a


Importing Tab Delimited Files -
I have to write a routine to import a Tab delimited file into an array. Nothing I do seems to work easily without the following work-around. Code: Line Input #iInHandle, sLine iCtr2 = 1 ' "sTemp" hold data as we read it in


Delimiter in a text box (RESOLVED) -
I use this: "|" as the delimiter in my text file, so I dont want the user to put that character into a textbox, or if they do I wnat to show a message box to tell them they cant use it. How can I do that?


How to set custom delimiter for a text file using jet oledb provider -
Dear Sir, How to set custom delimiter eg(|) for a text file using jet oledb provider through VB6.0 code at run time. Please let me know the solution for this problem. I know this can be done through ODBC but I want to do it at run time. If do you have any other alternate solu


Searching for a string inside a file -
Hi... Basically what I want to do is, read a file up to a particular word in that file, and store it in an array. Then, read the next part of the file up to that particular word and store it in an array and so on till the end of the file. something like the example file given below


importing text from access -
Hello I use this statement to import a text file but it doesn't import it as tab-deliminted, it puts everything into one field. How can I tell it to import the file using tab as the delimiter? Code: tmpAccess.DoCmd.TransferText acImportDelim, , strTable, strSourcePath, True


Importing Calendar items to outlook -
I have a delimited text file to work with (yea). The appointment subject, date and times import but the required attendees and meeting organizer do not. I have googled and grouped and searched and can only find that other people have had the same problem...since 2003 at least...


importing data through dbf file -
I am very much in problem in importing data from dbf file .Pelase suggest me to how to import data from dbf file .It is urgent. Prakash


Text file manipulation, speed issues -
May I suggest you go to Active-x.com and search for "DataChanger". It can change a file of one delimiter into another delimiter or convert it to fixed width and lots of other funky features. Or you can download it from: www.castleftarc.com/dc4.zip I know its a shamele


[2008] Split Problem - Help -
Main Question: How do I use a delimiter that is more than one character? Let's say I'm splitting apart some html source code, and "HTML" is the variable holding all the source code of a given page. html2arry = HTML.Split("Independent researchers suggest") ^^is m


Exporting to .CSV file using Tab delimiters -
I am attempting to create a tab delimited .csv file from my recordset. The act of outputting the file is working correctly, however I am unable to get it in “Tab delimited” format. First off, for my delimiter, I wanted to use \t (for tab), so I did the following: strDeliminator


Convert text file to Access 2000 -
Here's code that will convert a comma-delimited text file to Access 97. When I try to convert it to Access 2000, I get "Error Opening Database". I can't figure it out. What am I missing... Private Sub cmdImport_Click() Dim delimiter As String Dim wks As Workspace Dim


Importing CSV File -
Hello friends, In Access or Excel, microsoft provided Importing CSV File Facility. I would like to use same component. May i know how can i get that componet. so that i can use it in my application Thank you


Reading/Sorting delimiter-separated values -
Two questions: Can a spreadsheet be created using VB that reads using delimiter-separated values (read-only)? Is there an easy way to sort arrays of data in a text file? My problem is that I have a massive amount of information in a text file. I do not have Excel installed a


Split function delimiter question -
Does the Split function work with more than a 1 character delimiter? For example..........can you use Split to split this string into an array of strings using xz as the delimiter abcdxzefgxzhijkxzlmn etc


input text problem -
Good day.. I have a problem in importing text file in my vbasic. Everytime im importing it doesnt get the string exactly as the text have, sometimes it cuts and it brings to the other line and why the string function cant get the whole thing especially with numbers like 1.1.1.1.1.1.


Problem importing delimiter text file -
Hello and happy new year. I have a problem in reading a text file in VB 2005. What I want to do is to read a text file which contains delimited. eg. AA, date, value, color 1;10/10/2007;11552;blue; 2;15/12/2007;15222;red; I want the text file to imported in a winform in d


Why auto Execute ge -
I write something like: Private Sub cboDelimiter_Click() Debug.Print "Event Occurs la" Debug.Print "Delimiter=" & Delimiter(cboDelimiter.ListIndex) For i = LBound(Lines) To DisplayLineNo - 1 Items = Split(Lines(i), Delimiter(cboDelimit


Does anybody work with smartcards (chipcards) -
The way I save data to a smartcard is by writing a string to it's memory... I combine the text from the text boxes adding a delimiter. I then can read the string and parse on the delimiter. BUT HOW WOULD I SAVE A PHOTO? Thanks...


Automatically writing to SQLdatabase from a text file -
Hi!, Can anybody tell me how to solve this problem. I want to do this using a dll (I want to make it.). When the text file is updating(i.e. editing), database should be updated. There may be several fields related to a table of that database. Delimiter is a comma. when we press Enter


Importing files to an executable -
Hi I have problem that I hope someone may be able to halp me with. I have 50000 files that all contain 1 line of text, which I am parsing and importing to a SQL Server 7.0 Database. I was hoping that someone may be able to tell me how to imoprt the file into an executable(Parsing c


Convert Hex string Challenge -
I don't even know if this is possible using VB, but here is something that I know would be useful. Automatically (by command line) open a file Find a single hex value (or a string of hex) depending on the command line switch Convert each occurrence of the hex value (or string) to a


Can I unlock an Access MDE file -
Can I unlock an Access MDE file? If not, can I access the reports and modules in the file? I have no problem importing the tables, queries and macros but when importing the reports and modules are greyed out.


Problem with code - Resolved -
Hello, I'm getting an 'Invalid Procedure call or argument' error on this line. strTemp = Left$(InitialArray(x), InStr(InitialArray(x), "|") - 1) I can change the '-1' to a '+1' and it works fine but gives me an extra character that I don't want. What I'm trying to to is j


Import / Export from excel worksheets to text file -
HI GUys, need a little help with this, I need to transfer multiple cell contents from multiple sheets within a workbbook to a text file, and then be able to import the data back to the relevant cells at a later date. The cells in question will always be the same ones, but sometim


importing a textfile of unknown length -
Morning all, I have a very tricky problem with importing data into access Db tables which has been driving me mad and I was kinda hoping that someone would be able to help me with it... I have an access Db with several tables in it, all of the tables may have a different number o


Importing a .csv file into Access database -
Hi all, I'm having a problem when importing a .csv into an access database. I'm using the following code: DoCmd.TransferText acImportDelim, , "Table1", "C:\file.csv", True However, certain fields that should have a 'double' datatype are being imported as 'i


Stumping Microsoft - Text Delimiter in Schema.ini -
So far Microsoft is stumped but they are on their way and I am awaiting an answer. You can refer to "Exporting Text Files" a few topics down from this one that was posted. I have created a Schema.ini file through code to override the default export specs in the registry for


Importing a *.txt file to a Access database -
I have attached a file which I exported from a access database. Now I need to find a way of importing that table again?.I am able to create a blank table with the right fields in place, for the *txt file I just need to beable to import the data. Anyone know how??


Few very Basic Questions need quick advice -
I am kinda new in VB, appreciate somebody's advice on these few simple (may be idiot) questions. 1. How do trap user's input from common dialog box message? said user click a "Cancel" or "Yes" on the printing dialog, how could it trap the user's input and make d