Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Creating Tab Delimited Text Files


I am trying to put information from a form I have created into a tab delimited text file format. Can anyone help me with this? I can write information to a text file but I can't seem to get it in tab delimited format. Help! This assignment is due Monday!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Delimited Text Files
how do i create a c omma delimited text file from this file. could someone please give me some code using location as an example.

thanks
shann

LOCATION: NW27-1-1E

Owner: WRB
Driller: International Water Supply
Well Name: RM RHINELAND TH #2
Well Use: Test Well
Water Use:
Date Completed: Aug 09, 1971

WELL LOG

From To Log
(ft.) (ft.)
0 14.0 SILT, CLAYEY, LIGHT BROWN
14.0 23.0 CLAY, SILTY, GREY AND BROWN, OXIDIZED
23.0 42.0 CLAY, GREY, SOFT
42.0 145.9 CLAY, GREY, VERY SOFT
145.9 150.9 TILL, GREY, SOFT, GRITTY, COBBLES AND BOULDERS
150.9 157.9 TILL, GREY, GRITTY, HARD, BOULDERS
157.9 163.9 TILL, GREY, SOFTER THAN ABOVE, THIN GRAVEL LAYERS
163.9 164.9 GRAVEL
164.9 171.9 TILL, GREY, HARD, GRAVELLY LAYERS, BOULDERS
171.9 179.9 LIMESTONE GRAVEL AND LIMESTONE BOULDERS, CEMENTED,
LOST CIRCULATION AT 180 FEET

WELL CONSTRUCTION

From To Casing Inside Outside Slot Type Material
(ft.) (ft.) Type Dia.(in) Dia.(in) Size(in)
0 169.9 casing 2.00
169.9 179.9 perforations SL. PIPE

Top of Casing: ft. below ground

PUMPING TEST

Date:
Pumping Rate: 10.0 Imp. gallons/minute
Water level before pumping: ft. below ground
Pumping level at end of test: ft. below ground
Test duration: 1 hours, minutes
Water temperature: ?? degrees F

REMARKS

500 FT S + 80 FT E OF SEC LINE, FILE WRB RHINELAND, HOLE SEALED WITH
6 INCH BY 6 INCH PLUG AND CEMENT ON TOP OF IT, CHEMICAL ANALYSIS
(1971)

_____________________________________________________

Creating Delimited Text Files
I am very new at vb

can someone please give me some code on how to make the following file into a comma delimited file.

could you please use location as an example. i have to parse out the fields to use in access later.

time is of the essence

thanks very much
gus

LOCATION: SE9-1-1E

Owner: JAKE BEUCKERT
Driller: Paddock Drilling Ltd.
Well Name:
Well Use: Production
Water Use: Livestock
Date Completed: Sep 05, 1996

WELL LOG

  From To Log
  (ft.) (ft.)
      0 5.0 CLAY, BLACK TOPSOIL
    5.0 10.0 BROWN SILTY CLAY
   10.0 15.0 BROWN SILTY SAND, SHELLS
   15.0 18.0 VERY FINE BROWN SAND
   18.0 25.0 SILTY SANDY GREY CLAY
   25.0 30.0 PLASTIC GREY CLAY

WELL CONSTRUCTION

  From To Casing Inside Outside Slot Type Material
  (ft.) (ft.) Type Dia.(in) Dia.(in) Size(in)
      0 9.0 CASING 30.00 CORRUGATED FIBERGLASS
    9.0 29.0 PERFORATIONS 0.040 SAW CUT FIBERGLASS
      0 29.0 GRAVEL PACK WASHED SAND

Top of Casing: 1.0 ft. above ground

PUMPING TEST

Date: Sep 05, 1996
Pumping Rate: 10.0 Imp. gallons/minute
Water level before pumping: 5.0 ft. below ground
Pumping level at end of test: 26.0 ft. below ground
Test duration: 1 hours, minutes
Water temperature: ?? degrees F

REMARKS

PUMP TEST IS RECOVERY

______________________________________________________________________

Creating A Text Delimited File
I just took a visual basic course and I am writing very simple visual basic programs. One of the programs that I am writing creates a text delimited file. The problem the text is being created delimited by commas. I needed it to be delimited by spaces for example I need

"Mortgage" "234" instead of
"Mortgage","234"

How do I instruct visual basic to delimit my file with spaces instead of commas?? Thanks for your help

Creating A Delimited Text File
It's me, the noob, again. My project is going well, but now I'm into the thick of it.

I need to create a delimited .txt file using information from an access database. I have been using DAO thus far.

I am having trouble finding any documentation that tells me how to pull an individual field from a record and write it to file. Any help/advice would be greatly appreciated (once again). thanks,

Jason

Extremely Large Delimited Text Files In ADO
Hi all

I am embarking on my first major VB project at work - I've done a few small system databases in Access - and I have a question I'd like answered, that will aid me in choosing which direction I should follow.

I am developing an interface which will allow us to upload data from SAP/R3 to our Records Management software - TRIM.

The only problem is that the only way our SAP people can provide the data to be uploaded is in a total snapshot of their data each week. This file is in the form of a pipe (|) delimited text file which is currently (the SAP people tell me) 8 - 9 Mb in size and will only continue to grow.

I have read previous posts on this site Re using ADO to access delimited text files as databases and this is the road I was going to follow.

My question is this: will VB (it's the only tool I have access to at present, and the only one I'm likely to as well) using ADO be able to handle reading in two Text Recordsets of 8 Meg or so and do full on SQL compares?

Is this type of thing only dependent on my machine's RAM?

I MUST do a full compare each time because I have check for any modifications in each record from the last data dump to the new data dump and only add new records or modified existing records.


Any help would be muchly appreciated.

Tab Delimited Text Files With Commas In.[resolved - Thanks Guys]
Here's one guys,

I need to process a tab delimited text file line by line however the lines also contain commas.

I would normally just use


VB Code:
open InFile for Input as #1 do while not eof(1)Input #1, Line'do stuffloop close #1


..and that's fine however the problem is that when Input see's a comma, it thinks it's the end of the line and starts a new one. Is there anyway to overcome this or is there an alternative method I can use?

Cheers!


Peter

To Import Tilde Delimited Text Files Into A Table
Hi

Can somebody help me out to import the Tilde Delimited text files into a table

Creating Tab Delimited Txt File Using Fso?
Hey guys

Ive created a vb form within which users enter specified data.

waht i need to do now is, as part of my code within this VB form, have a command button that creates a tab delimited text file that contains the data that has been entered into the form using fso...

im really at a loss as how to do this, im able to create a text file with fso, but i dont see how to have the data that has been entered into the VB form saved inside the txt file

hope someone can help!

Thanks

Creating Text Files And Saving Text To Them.
This is the best I can find to create a textfile and save a string variable's contents to it.  Logically it doesn't make sense to me since you would first need to "create" a file before "opening" it, so either I just don't get it, or this is wrong.

Either way, it's not working, and generates the error: Run-time error '52': Bad file name or number

What am I doing wrong?
CODE'Saves to Text File
Dim strUserText As String
strUserText = "This is a bunch of text to save in a textfile."

Open "c:ProgramLogsLog_" & Date$ & ".log" For Output As #1
Print #1, strUserText
Close #1

Creating A Comma Delimited File Then Parsing It
Yes it has to be put into a comma delimted file

Creating Text Files
Is there anyway to check to see if there is already a text file in a certain destination and then if there isnt, create it?

I want to make a high score form for my game. I want the game to check to see if there is a certin file with the name, 1.txt, in (app.path)millionaire and if there isnt create it. How would I do that?

Creating Text Files Within An App
Hey guys, heres my question. Ive got a listbox (list1) which lists all files in a folder selected by a user. I was wondering how to go through the list and for each file, make a corrisponding text file using the same file name. My next question would it be possible to have a template text file so to say and have the app just change the numbers for size in the text file.
Thanks guys for all the help
Dave

Creating Text Files..
This is an easy question just can't remember how to do it. Anyway, all i need to know is how to create a text file in the same directory as the main project.
Thanks to anyone who can help me.

Creating Text Files
Well, I'm not quite that bad, I know how to create text files, but how can I have it check for the files existence? If it doesn't exist, I want it to create it, but if it does already exist I want it to append and not overwrite what's already in the file.

Creating Text Files
Is there a way for VB to create a text file? I know it can open one and write to it, but can it actually create one?

Creating Text Files
ok so this probabally really simple but i just cant remember


how do i make a text file and overwrite any other files of the same name??

Creating Text Files
Hey everyone...I want to create text files with the name based on a field in my other text file. How do I do this?
-----------------------------------------------------------------------------------------------------------------

While Not EOF(fnum)
    Input #fnum, observer, thetime, dates, location, northing, easting, species
    If observer = "Jim" Or observer = "Bob" Then
        Fnum2 = FreeFile
        Open "M:" & observer & ".txt" For Input As Fnum2
        Write #Fnum2, observer

--------------------------------------------------------------------------------------------------------------------
Thanks

Creating And Writing Into Text Files??
Hi
i want to create a text file by using vbs (script) and want to write in this file ?
plz help
THANKS

Help: Problem With Creating And Reading Text Files
This problem seems so annoying, because I don't know where I'm going wrong.
I'm making an app that simply creates and reads text files.

Code for my Application

Quote:




Private Sub Form_Load()

'check if file exists
If Dir$("c:pass.txt") <> "" Then
'it exists, so set it as password
strPassword = ReadFile("c:pass.txt")

Else
'if it doesn't, create it
Call WriteFile("c:pass.txt", "clickclick")
'load it to txtGetPass
strPassword = ReadFile("c:pass.txt")
End If

End Sub

Public Sub WriteFile(FileName As String, Contents As String)
Dim i As Integer
i = FreeFile

Open FileName For Output As #i

Print #i, Contents
Close #i
End Sub

Public Function ReadFile(FileName As String) As String
Dim i As Integer
i = FreeFile

On Error GoTo ErrorTrap

Open FileName For Input As #i
ReadFile = Input(LOF(i), i)
Close #i
Exit Function

ErrorTrap:
ReadFile = ""
End Function




This app check if the file FileName exists. If it doesn, great!, it sets it as strPassword. If it doesn't, it creates a file with FileName and Contents, loads it and sets it as password. Simple, right.

Well, here is the problem: Everytime I save "c:pass.txt", with the Content "clickclick", it saves it with a black line after the "clickclick". My text file therefore contains to lines. One with "clickclick", and the other with nothing.

So, when my program loads up "c:pass.txt", it manages to load it up, but it loads it up with the two spaces after, therefore chaning strPassword. This is what strPassword therefore looks like: clickclick -- and then a blank line.

Anyone got a solution to my problem. Any help will be much appreciated. Thank you very much.

Ankur

Need Help Creating A Text File Of Copied Files
I have written a program that copies files from one machine (cpu1) to other machines (cpu2, cpu3, cpu4). I need to write a log on the local machine (cpu1) stating the machine name of the copied to (cpu2) and date as the title of the log. When you open the log it has the files that were copied.

Thanks

Creating One Text File From Existing Files
Hi,

I really need help with this one! There are at least 2 or more batch files but with unknown names. Now, what I need to do is copy all the texts from each and every one of them and save them in one file.

Any help or suggestion would be very much appreciated.

Creating Form To Export Data To 2 Text Files.
I have access to both VB 6.0 and VB .NET 2002 so help on either is appreciated.

If this is not the place for this question I understand, please just point me to where I should be going.

I do not have a heavy programming background however I have written a very useful VBScript to perform several functions. This script has two text files that it depends on for configuration (ie: a list of files it must remove).

In order to better faciliate the script I want to create a VB form that depending on which check boxes are selected it will populate the two text files required for the script. Additionally I would like the values that it will populate from to be stored in an access database table(s).

#1 How difficult is this going to be with someone of a decent amount of scripting experience but not too much app programming.

#2 Are there any samples out there that I can look at?

#3 Is there an easier way than what I have listed above?

Any help is greatly appreciated.

Thanks again,

Jim

Creating A Text File That Lists Files And Timestamps
I am copying files from one machine to others and I have a .txt file that I want to list the files that were copied. How would I do that?

Rem write
Open "c:update.txt " For Output As #1
Print #1, ????
Close #1

Is there a way to list every file is the folder that I am copying from and write that to the c:update.txt?

Thank You

Delimited Files
Hi,
I have two problems.
FIRST
What is a delimiter? What are delimited files.
SECOND
I read somewhere that using delimited files to store information for your application is not good practice (the book failed to explain what delimited files are). However, I want to create an application for a small company that does not have Database Programs (not even Access) so what should I use as an alternative.

Thanks.

Working With Delimited Files
This may be dificult but here goes. I have a delimited file that I need to read/open in a RichTextBox that I have on a program, it looks like Windows Notepad. Once the file is opened in the program it needs to filter out what I don't want and just focus on what I do want. In the program it will calculate the number of occurances of a number that's in the file. An example of the first 5 lines of my data file is below.

all I need it to focus on is the set of numbers grouped like 5,11,29,47,50 and 17 from the first line in the file. The rest I don't want it to count/calculate or pay attention to.


9-6-1996; : 5,11,29,47,50; Money Ball: 17
9-13-1996; 3,4,9,30,47; Money Ball: 1
9-20-1996; 5,24,31,34,48; Money Ball: 6
9-27-1996; 8,25,35,37,48; Money Ball: 8
10-4-1996; 8,16,18,36,38; Money Ball: 1
10-11-1996; 2,23,37,40,50; Money Ball: 22


Anyone know where I can start with this? i'm running vb.net 2005 express by the way.

Thanks in advance to anyone that can help me.

How To Split Tab-delimited Files?
I've got an tab-delimited file that I need to split up. I've no problems splitting up .csv- files, but don't know how to split tabs. Can someone help me?
An option could be to convert the file from tab- separated to .csv, but how do I do that?

Help With Ascii Delimited Files
OK I got this about done except for the hard part...imagine that.

I got a file with records delimited by a þFIELDþþþþFIELDþ
where the þþ are right next to each other is where the value is null. here is a better example...a full record:

þMailþþ12/05/2000þþCN=Zandrea O /OU=MI/O=CMAþþKevin D /MI/CMA; Kelly A /MI/CMA; Angela M /MI/CMA; Patrece L /MI/CMA; Deena /MI/CMAþþþþþþP103B1383I1S0þþ9E10D692-354B-4B18-AFCE-A33041240A8BþþMailþþþþþþ12/05/2000þþCN=Zandrea O /OU=MI/O=CMAþþKevin D /MI/CMA; Kelly A /MI/CMA; Angela M /MI/CMA; Patrece L /MI/CMA; Deena /MI/CMAþþþþþþPersonal Accountability Seminar with Judy in JAD ROOM 2.þþþ

I know what trhe fields are, they are:
Documenttype, Senton_date, AuthorEmail, SentTo, CC, BCC, Docid, ProjectUID, DocumentType, FileDisplayName, AttachmentLocation, SentOn_Date, AuthorEmail, SentTo, CC, BCC, Subject, Body

I was thinkning about making a UDT and reading each field into it but I still dont know how to get past the  delimiter. Is this my best option...any suggestions?

Working With Tab-delimited Txt Files
Hello again, im trying to import an tab-delimited text file and id like to know on how to open it using vb 6? heres the scenario.. Once ive imported the txt file(tab-delimited), i will now generate a report using data report to display the results in the tab-delimited txt. thanks in advance!

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
sTemp = ""
' parse the line to the array elements - look for "iDelimitChar" which
' is the delimiter between fields
For iCtr = 1 To Len(sLine)
' look for delimiter
If Mid(sLine, iCtr, 1) <> Chr(iDelimitChar) Then
' it wasn't a delimiter char, so add it to "sTemp"
sTemp = sTemp & Mid(sLine, iCtr, 1)
Else
' it was a delimiter, so we are thru with this element - load the
' array element with the value of "sTemp"
sArray(iCtr2) = sTemp
' re-initialize "sTemp" and increment the element counter ("iCtr2")
sTemp = ""
iCtr2 = iCtr2 + 1
End If
Next iCtr
' Once we fall out of the loop, it's because we have reached the end
' of the line. Since there is no trailing delimiter, then everything in
' "sTemp" will go into the last array used element
sArray(iCtr2) = sTemp

Doing it this way works, but is s-l-o-w. Can anyone speed up this code? BTW, the client cannot change to a comma delimited format, which would be real easy for us.
Thanks.

CSV(comma Delimited Files)
I have to write an exe that monitors a comma delimited text file, open it and add the data to an Access database for web access. I need a jump start. I don't know where to begin.

Coma Delimited Files
I have 3 coma delimited files that holds more or less relational database information. I am trying to step through each file a record at time and read each different field into a seperate array for each field for use later on in the program. Can anyone assist me in the proper code to use for these. '

Thanks,
Alfred

INPUT Statement And Delimited Files
I have data in an excel file that has dbl quotes (") AND commas (,) in it, so when I save it as a CSV file the INPUT command has a problem, since it doesn't know where each piece of data ends. Is there no parameter at the end of the input command like "DELIMITED BY..." where I could specify WHAT each piece of data is delimited by OR does it have to be a comma? If I use another delimiter (like say ~) is the only solution to do a character by character check for that specific delimiter and parse the data myself?

Seems VB should be smarter than that (i.e. have an option to specify the input delimiter).

BTW, have I said 'delimit' enough yet?

Thx!

Comma Delimited Files Without Quotes?
To all:

I am new to visual basic. I have used Quickbasic over the years and I am now trying to make the switch.

I would to like to write an output file as comma delimited but without commas surrounding each string. I am using Visual Basic.Net.

Print/PrintLine will write without the quotes, but the data is seperated with Tabs.

Write/WriteLine gives me commas but everything is in quotes.

This could be done in QuickBasic, but I can not figure out how to do in Visual Basic. Any suggestions?

Pete

Does VB6 Recognize Semicolon Delimited Txt Files??
Hello,
I am new to VB. I am using VB6 and I am trying to get VB to open a semicolon delimited txt file. I have not been successful in getting VB to open this file.

Below I have attached some code....could someone with a lot of VB experience, please, take a look at it and tell me if the code will work and if it won't then how do I make it work???

Could everyone who responds....PLEASE....be very detailed and specific???

Would someone also please tell me if VB recognizes semicolon delimited txt files???

I would like to ask that if anyone who reads this thread has VB6 experience...please reply so that myself and others would get a good explanation from different people.

Thanks,

BHowerton

This text file usually has anywhere from 40 to 85 records.

I have also attached a txt file that has the typical information in the text file that I am trying to work with.

Option Explicit
Dim aircraft(0 To 99) As String
Dim mission_type(0 To 99) As String
Dim mission_number(0 To 99) As String
Dim leg(0 To 99) As String
Dim icao(0 To 99) As String
Dim sched_depart_date_time(0 To 99) As String
Dim actual_depart_date_time(0 To 99) As String
Dim delay_code(0 To 99) As String
Dim delay_time(0 To 99) As String
Private Sub mnuExit_Click()
End
End Sub
Private Sub mnuFileOpen_Click()
Dim i As Integer
Open "c:deps.txt" For Input As #1
Do Until EOF(1)
Input #1, aircraft(i), mission_type(i), mission_number(i), leg(i), icao(i),
sched_depart_date_time(i), actual_depart_date_time(i), delay_code(i),
delay_time(i)
i = i + 1
Loop
Close #1
End Sub

Importing Delimited Web Files To Access
I have a web site that is essentially a comma delimited text file. What is the best way to import this into Access 2000 using VB?

Splitting Comma Delimited Files
Hi all,

I have a comma delimited file that I need to read into an array. I am running into problems when one or some of the fields have an embedded comma.

For Example:
Record 1
WHCO,AM,"68,112-A",117,HOUSTON,32775,AK056008,,001,07
Record 2
WLGA,FM,19265-1,063,"COLUMBUS,GA",20000,AF012061,,001,08

In this case I want the third field of the array to be "68,112-A" for record 1, but when I use the split function I get 68 as the third field and 112-A as the fourth field.

Same problem for record 2, I want "CULUMBUS, GA" to be as the fifth field not just "COLUMBUS".

Quotes are placed on the field that contain an actual comma as part of the field.

here is my code:
varLongString = Split(LineIn(rcount), ",")

How do I solve this problem? Any help is apreciated.

Thanks


Using Data From Tab Delimited Files In My Aplication
I am a learner programmer in VB6 & I want to create an application that gets statistics from an utility called Windows Uptime(it monitors the utilization of computers, and stores it in log files (tab delimited files)).I intend to use these statistics within my application so as to be able to print reports and also compare uptime between,e.g. days, months etc
 
This is part of a project I am undertaking, but I have been stuck on how to start. I have more that I want to do with this project, and I am willing to recieve any help.

Tab Delimited Text File Text Parsing
I have a query that I wrote and ran in SQL Analyzer which produces three columns of information from three different tables. I set Analyzer up to dump the contents of this query to a text file rather than in its grid. I now have a tab delimited text file with the three columns of information.

What I need to do now is read that text file in using Vb, and dump the contents of column one into Richtextbox1, column two into Richtextbox2 and column three into Richtextbox3. How would I go about doing that?

Grid-editing Delimited Files...control Help Needed.
Hey all...noob to this forum. This is a "duplicate post," as I didn't know if it more closely fit the File I/O or database areas, given the direction I've gone.

Hope you all can help with a sticky app issue.
My client wants the ability to edit a Pipe-delimited file in a grid format within a single-form app. I've tried the following...

1)OLE imbedded Excel instance: "floats" from form, resizes awkwardly and is hard to navigate in.
2)Excel Sheet object (non-OLE): can't figure out how to associate with or manipulate external file with object.
3)DataGrid/Connection combo, using either "OLE Jet" or "ODBC Text Engine" connection to flat file as table: Can read and add, but unable to edit or delete. Message along the lines of "updates/deletes not allowed to linked tables with this ISAM." From what I've read via MSDN, ODBC Text driver actually instantiates Jet engine, so these are basically the same connections.
4)DSO ActiveX Document Framer: perfect, if it would allow opening of non-XLS files in Excel...no dice on that.
5) Excel Application object...created external instance of Excel...needs to be in-form to meet specs.

...I'm running out of ideas here. My thoughts are that it is a function of the Jet engine being used to connect to the source file...if it is just the connection, how would anyone recommend connecting so as to allow updates/deletes? By the way, importing to Access, editing and recreating the file is a non-starter, as there are too many "touches" just for opening a file and deciding that nothing needs to change.

If it is the control itself, what would you recommend using for direct, full-function editing of a pipe-delimited text file in a grid-type control that plays well within a VB6 form and does not involve purchasing extra 3rd-party tools (Standards committee won't support without 6 months of red tape and "evaluation")?

I have about two more days to identify a solution.

Reading Comma Delimited Files Into String Arrays
I want to read a specific line of a text file into a string array, so for example if I had a text file where line 1 read test1,test2,test3,test4 I would like to open it and input it into a string array called testarray so that this code would work:

dim testarray(0 to 50) as string

testarray(0) 'this would be=test1 from text file
testarray(1) 'this would be=test2 from text file
testarray(2) 'this would be=test3 from text file
testarray(3) 'this would be=test4 from text file

Can anybody help me please?

Oh I forgot to mention, this post is for help using VB6.



Edited by - G2LAndrew on 1/18/2007 2:30:54 AM

Tab Delimited Text
Hello,

I am taking a text file from an Excel sheet that is tab delimited and reading it into my application. The main problem that I am having is that at the end of each record there are many tabs and at what should be the eof there is several more records that are blank.

I do not know how to handle this for I am rather new to programming and I am eager to learn if someone can point me in the right direction. I looked through the threads in this site and could not find anything that dealt with this issue.


Thanks in advance,
DemoPro

Text (Tab Delimited)
I am trying to export to a note pad in text (tab delimited) format but each time i click on the button my pc Hang. Below is the code. Is this the right way ?

How do i export out to Text(Tab Delimited) Format?


<vbcode>
Dim s As String
Dim i As Integer
Set adoRecordset = New ADODB.Recordset

SQL = "SELECT * FROM tb_policy where policyno BETWEEN '" & Txtpoli1.Text & "' And '" & Txtpoli2.Text & "' "
adoRecordset.Open SQL, adoConnection, adOpenStatic, adLockOptimistic, adCmdText

s = adoRecordset.Fields

While Not adoRecordset.EOF
For i = 0 To adoRecordset.Fields.Count - 1
s = s & adoRecordset(i).Name & "~" & adoRecordset(i).Value & vbCrLf
Next i
Wend

Open "C:Back.txt" For Output As #1
Print #1, s
Close #1

</vbcode>

Parsing Tab Delimited Text
Hi all, I'm using Regular Expressions in VB6 in order to gather each substring of a Tab-Delimited-Text in a Match collection. Example:


Code:
strText = "abc" & vbtab & "defg" & vbtab & vbtab & "hi"
By executing the regex method, I should obtain the FOUR matches below:

"abc"
"defg"
""
"hi"

I'm using the following pattern...


Code:
strPtn = "([^ ]*) ?"
...but I obtain FIVE Matches (with the undesired empty string at the end):

"abc"
"defg"
""
"hi"
""

Can anyone suggest a correct RegExp pattern for this issue?

Tab Delimited Text File
Hi,

I am not sure what is happening here. I need to create a tab delimited text file and here is what I am doing:

Dim strTextLine As String

'open file.
Open "test.txt" For Output As #1

strTextLine = "!TRNS" & Chr(9) & "TRNSID" & & Chr(9) & "TRNSTYPE"
Write #1, strTextLine

'close file.
Close #1


When I open this in Excel, the tabs were not set. All the text is in the first cell and the tabs are seen as "squares" within the text.

What am I doing wrong here?

Thanks.

Delimited Text File
I am creating a tab delimited text file and inserting the following line:

Dim TransmitID As String

TransmitID = "000002"

Print #3, TransmitID; Chr(9); " "; Chr(9); Date; Chr(9); Date

This is fine but when I import this text file into excel it removes the leading zeros of the TransmitID. Anyone any ideas?

Also I have another line:

Print #3, rstMyTable!ck_tot; Chr(9); rstMyTable!Error

The field ck_tot is a Numeric field with 2 decimal places, but when it is imported into excel it is just a whole number.


Anyone any ideas?

Delimited Text File
Hi Everyone,

I'm trying to convert a Delimited text File to Excel. The text file uses the "|" (pipe) character as the delimiter.

What I need to know is how to detect whether a text file is delimited or not ?

I would really appreciate it, If someone could illustrate an answer with some code.

Thanks..

Delimited Text File To Dbf
How can I import a delimited text file and export to a dbase file through VB.
Thanks!

Tab Delimited Text File
I am creating a tab delimited text file and inserting the following line:

Dim TransmitID As String

TransmitID = "000002"

Print #3, TransmitID; Chr(9); " "; Chr(9); Date; Chr(9); Date

This is fine but when I import this text file into excel it removes the leading zeros of the TransmitID. I know excel does not recognise it as a string but I need to have the leading zeros.

Also I have another line:

Print #3, rstMyTable!ck_tot; Chr(9); rstMyTable!Error

The field ck_tot is a Numeric field with 2 decimal places, but when it is imported into excel it is just a whole number.


Anyone any ideas?

Delimited Text File
Hey! is anybody out there know how to open a delimited text file by using the ADO object?

Thanks,
Chris.C

Copyright © 2005-08 www.BigResource.com, All rights reserved