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




Slurp Large Text File!


How can I slurp a large text file (300Mb+) into a single variable. How can I make use of the variable length string's 2 Billion Characters?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Very Large Text File
What control would you suggest loading the entire text file (5mb +) into so the user can scroll through the file and view it unedited? (As read only)

Im using a listbox, but it takes awhile for it to load, any suggestions?

I would like to have the user be able to scroll through the data using their scroll wheel on the mouse, how do I implement that?

Lastly, how would I make a progress bar to show how far through the text file the program is? I was thinking I could go through the file first, have it count the number of lines, then just use simple VB graphics to fill up the bar based upon how many lines its gone through so far. Is there an easier way of doing this?

LArge Text File
I am opening a txt file and filtering out un wanted spaces. The file is approx 350 mb.

The program is hanging on the 1st line input statement. It is hung now or I would copy cut and paste the code. Why is that? Any suggestions on getting around this problem?

The code is something like this:

Open FileName for input as #1
Open OutputFileName for output as #2
While not eof(1)
line Input #1, strInput
' Filtering code here

wend
Close #2
Close #1

Thanks
LJ

2D Strings Compare Large Text File With Dat File
Hi
i am trying to compare a search a large server.log for listings stored in a dat file
one by one.
so

dat file listing like this

mr a
mr b
mr c

then look in the server log file line by line for mr a, mr b and then mr c then if say at line 20 a hit on mr c is found stop, perform a task then resume the search till the next hit or till the end of the log

also as the server log is constantly updated i want a way to remember last postition and only scan the new additions to the log not the whole thing over and over

not asking for some one to hand it to me on a plate as i want to learn this as i go but allmost idiot proof examples of code would be very much welcome

thanks again

Reading A Large Text File
At about line 1,426 VB decides it doesn't want to read anymore. How can this be fixed?


Code:
Dim ff As Integer
Dim readme As String
ff = FreeFile
Open readmes_path & "" & frmReadmes.File1.FileName For Input As #ff
readme = Input(LOF(ff), ff)
Text1.Text = readme
Close #ff

Edit A Very Large Text File
Dear Guys,

I have a problem with a massive text file which has the following format:

xxxxxxxxx
xxxxxxxxx
xxxxxxx">
cccccccc
xxxxxxxxx
xxxxxxxxx
xxxxxxx">
cccccccc
xxxxxxxxx
xxxxxxxxx
xxxxxxx">
cccccccc


Basically I want this to end up being:

xxxxxxxxx
xxxxxxxxx
xxxxxxx">cccccccc
xxxxxxxxx
xxxxxxxxx
xxxxxxx">cccccccc

etc....

So every time there is a "> it should move the line after that right next to it using the delete or removing the line feed.

Please help as I havent used VB in quite a while and need help.

Thanks and Regards

Large Text File Import
I hope someone can help me with this: I have to import a text file (using a VBA code) which is more than 65536 rows long into Excel. Preferably, the macro has to split the text file in two and devide them over two worksheets. Any suggestions?

Large Gaps In Text File
Hi, I have a basic program that writes records from text boxes to a file.

Each set of records start on a new line.

After I enter a couple of sets of data and check the text file I find that there is large gaps at the begging of each new line.

Could someone please look through my code to see if they can find why it is doing this?


vb Code:
Dim LineCount As Long, DataLine As String  Option Explicit Private Type NoteRecord    StaffID As String * 4    Title As String * 4    Fname As String * 20    Sname As String * 20    DOB As String * 10    Address As String * 50    Town As String * 50    PCode As String * 7    HPhone As String * 12    MPhone As String * 11    Email As String * 50    JStatus As String * 8    AType As String * 9    APassword As String * 50       End Type Private Sub cmdcreate_Click()Dim i As IntegerDim file_name As StringDim fnum As IntegerDim note_record As NoteRecordDim value As StringDim l As Integer  Screen.MousePointer = 11 ' hour glass l = lblgetline + 1       ' Open the data file.file_name = App.Path    If Right$(file_name, 1) <> "" Then file_name = file_name & ""    file_name = file_name & "accounts.txt"    fnum = FreeFile    Open file_name For Random As fnum Len = Len(note_record)    ' Save the records.                    For i = l To l        note_record.StaffID = Trim(txtStaffID.Text)        note_record.Title = Trim(cmbtitle.Text)        note_record.Fname = Trim(txtfirstname.Text)        note_record.Sname = Trim(txtsecondname.Text)        note_record.DOB = Trim(cmbday.Text & "/" & cmbmonth.Text & "/" & cmbyear.Text)        note_record.Address = Trim(txtaddress.Text)        note_record.Town = Trim(txttown.Text)        note_record.PCode = Trim(txtpostcode.Text)        note_record.HPhone = Trim(txthomephone.Text)        note_record.MPhone = Trim(txtmobilephone.Text)        note_record.Email = Trim(txtemail.Text)        note_record.JStatus = Trim(cmbjobstatus.Text)        note_record.AType = Trim(cmbaccounttype.Text)        note_record.APassword = Trim(txtpassword.Text) & vbCrLf        Put #fnum, i + 1, note_record      Next i        ' Close the file.    Close #fnum    Screen.MousePointer = 0 CreateStaff.Hide      End Sub Private Sub Form_Load() 'see how many lines are in the file to see where to put nextOpen App.Path & "/accounts.txt" For Input As #1Do Until EOF(1)    Line Input #1, DataLine    LineCount = LineCount + 1Looplblgetline.Caption = Str$(LineCount) Close  'adds user types to list boxcmbaccounttype.AddItem "Admin"cmbaccounttype.AddItem "Reception"cmbaccounttype.AddItem "Maid"cmbaccounttype.AddItem "Caretaker"  End Sub


Thanks

Sorting A Large Text File
Hi, I have a text file with about 80,000 lines and I need to convert it to an other format. Converting is not a problem, but I have no idea how to sort the new text file in alphabetical order. A Listbox and Listview can't hold so many lines.

Thanks.

Sort Large Text File
Hello All

I am trying to do a sort on a very larger text file, approx 75 MB. I have implemented the code below, but I am having a problem copying the file at the end of the run, I get a 75 file access error. Is there a reason why I cannot copy the file even though I closed both of them?

By the way is there a better way of doing this beside a bubble sort?

Thanks Steve


VB Code:
Private Sub ProcessFile()Dim SortComplete As BooleanDim BeginRead As BooleanDim SrcFileNum As IntegerDim SrcFilePath As StringDim DesFileNum As IntegerDim DesFilePath As StringDim SrcString1 As StringDim SrcString2 As StringDim i As LongDim j As Long        Do While SortComplete = False                SrcFilePath = "c:Combined.txt"        SrcFileNum = FreeFile        Open SrcFilePath For Input As SrcFileNum            SrcFilePath = "C: emp.txt"        DesFileNum = FreeFile        Open SrcFilePath For Output As DesFileNum                j = j + 1        SortComplete = True        BeginRead = True        Do While Not EOF(1)            DoEvents            If BeginRead = True Then                Line Input #SrcFileNum, SrcString1                Line Input #SrcFileNum, SrcString2            Else                Line Input #SrcFileNum, SrcString2            End If                        BeginRead = False                        If SrcString1 < SrcString2 Then                Print #DesFileNum, SrcString1                SrcString1 = SrcString2            Else                Print #DesFileNum, SrcString2                SortComplete = False            End If            i = i + 1            If i Mod 1000 = 0 Then Debug.Print "Run: " & j & ", Line: " & i        Loop        Print #DesFileNum, SrcString1                Close #SrcFileNum        Close #DesFileNum                DoEvents                FileCopy DesFilePath, SrcFilePath     Loop End Sub

Very Large Text File Manipulation
I have a SQL script that I am including in my instalation that will create the database for our app.

In VB 6, I have a dialog that would allow the user to choose the name of hte database, server, etc.... and create the database, and then create configuration files.


However, the database script is roughly 30,000 lines. The VB app does not like me using an "Open" or a file scripting object call. It freezes up the computer. The code is correct though, when I use a smaller file ( 3000 or less lines) I have no real slow down whatsoever.


Any ideas?

Thanks!

-Jason

Reading Large Text File
thanks for trying guys but still hanging. STARMAN - that would make sense, how would i found this out or go about replacing the characters??

TextEditor For Large Text File
Anybody can point out a good Texteditor for a large text file, saying 30 mb?

Large Text File Parsing
I am using


PHP Code:





 Dim varText 

Searching In A Large Text File
Hello, I'd like to search for movie names in a large text file and return the matches. I know how to do it with predefined words, but what I'd like to do now is more complicated.

This is the code I normally use with predefined words.


Code:
Private Sub Command1_Click()
Dim sLines As String

Open "C:movielist.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, sLines
If InStr(1, sLines, "matrix") And InStr(1, sLines, "revolutions") Then
Text1.Text = Text1.Text & sLines & vbCrLf
End If
DoEvents
Loop
Close #1

End Sub


Now I have this in a textbox:


Code:
!search matrix revolutions final end


If "!search" is in the textbox, then the other words (excluding "!search") need to be used as search strings, but only if they are at least 4 characters. In this case "matrix", "revolutions" and "final".

I know I can find out if "!search" is in the textbox with the Left function and that I have to put the words in an array, but how do I only add the words with at least 4 characters to the array and how do I use the array to search in the text file?


Code:
Private Sub Command2_Click()
Dim strArray() As String

If Left(Text2.Text, 8) = "!search " Then

strArray = Split(Text2.Text, " ")

End If

End Sub

Finding Text In A Large File
Is there a way to find text within a large file (several megabytes)? I'm trying to find out if a chm file contains a topic, and it looks like the topics are listed at the top. Alternatively, if there is something that allows me to find this out, rather than open a dialog with "page not found" displayed, that would work to solve my problem.
Thanks in advance.

Displaying A Large Text File
I want to read a large text file and display it as a wordpad. How can I do this. I tried to display my file using notepad but it displays only part of it. I suspect this is due to a limitation in notepad. Any sample code would be much appreciated

Thanks in advance

Deepal

Large Text File Editor
At my job I need to view files to verify that the data is not corrupt, some of these files are very large(4 gigs or more sometimes) and I am limited to 2 gigs with text editors such as SlickEdit, etc. My first option was to find a suitable editor on the internet, but every one that I downloaded had a similar limitation, and the ones that were supposedly unlimited file size tried to load the whole file into memory, which doesn't work. So now I am thinking I will have to write my own editor that will only load portions at a time, view that portion, then load another portion and unload the previous. I would like to update the line count for each portion of the file. I only have a little over a year's experience programming, so I am not sure if this is out of my league. If any of you could steer me in the right direction, pertaining to how to only load a portion of the file into memory(I think VB has a 2 gig limit, so this will have to be done) I would greatly appreciate it.
Sean

Reading Last Line Of Very Large Text File
Hi

Can anybody please tell me a way of reading the last line of a very large text file.

Each line is of a fixed length and are comma seperated.

Any help would be most appreciated

Scouse

Reading A Large Line Of Text From A File
I have log files that can be easily read using notepad and such. Though it is seen as one big long line of info when reading this into a string, ie



Code:
strString as string
Open C:file.000 for Input as #1
Line Input #1, strString
the file ranges from 3-5 MB.
loading the string takes about 1 full minutes to do the input part, (processor cranks up a bit, using a decent machine 2Ghz with 1Ghz ram)

not to mention the lengthy time it takes to hack up the string once I do get it loaded. I have searched and looked at many of the File I/O threads, but did not find one that related to my one line 4mb file. How can I speed this up.

Import Large Text File To Excel?
Hello, Everyone:
I would like to input a text file to my Excle data sheet. It has more than one line and I want to the excel sheet has 32 column with each row. How can I do it manually and in VBA also?
Thank you very much!
Charlie

Speeding Up A Text Search For A Large File
i have text files between ~8M and 40M ranging from ~5000 lines to 50000 lines, with 9 'columns' of data (8 tabs per line)

using most of the search code i have, if the number of results returned is small (500 or less) the search goes fairly quickly. 10, maybe 20 seconds (win XP, 2gb cpu, etc)

but if the search is to return 4000 records i'll be waiting for 4 min or so. and all the data is right here on my PC. that just seems way too slow. there must be a much faster way to dig into a large file and, before you can blink, it returns the results, no matter how many there are

it seems the issue is not the number of lines that slows the search down, but the number of results returned.

hopefully there is a way to do this.

Problem When Open Large Text File
i make a programe which open text file then replace each char. in it with another char.
i but the text i open in a String >>>all are right but the problem appear when i open a large text file(more that 3000 lines) then i press the button to do the process but no result appear in the textbox >>>
while if i open text file which have for expmle 1000 lines the programe work very good>>>>
where is the problem>>>>>>

Handle Large Text File Superfast
Hi all,

I have a large text file like 50000 lines (minimum). My program reads this file and do some modification in each line and write it to another text file.

That's what I do?

Normally if the text file has only 100 lines then it takes only 2 seconds to process it. But if the file is large then it takes even 10 seconds to process each 100 lines.

How to fix this issues? I need to keep the process time as 2 seconds for each 100 lines for any number of lines.

show me the best way to do this.

Thanks in advance.

Display Large Text File In Textbox
hello all

I have to open and display a selected portion of large file (more than 64K) but I'm getting problem when using textbox or richtextbox. The program always hang when using this method.

Any other solution?

Thanks.

Reading Last Line Of A Very Large Text File?
Hi

Can anybody please tell me a way of reading the last line of a very large text file.

Each line is of a fixed length and are comma seperated.

Any help would be most appreciated

Scouse

Best Way To Read A Large Text File Quickly
I'm still a fairly novice VB programmer, but i've been knocking up some bits and bobs to teach myself.

I've written a random URL generator that picks a random word from a large text file and opens up a basic web browser window to see if it turns out to be an actual site.

The problem is that the text file containing the random words is 180,000 lines long and takes forever to read as I choose a line at random and read the file line by line until i get to the chosen word.

Is there a quicker way to read it ?.

I want to be able to continually add words to the text file y'see, so i can't really create an array in the program as it would defeat the object of adding to the file.

Any clues would be most welcome .. thanks ..

Import Large Text File To Access Db
I have a large text File (more than 20Mb) and I can import it easly in a Ms-Access Db using the below codes. But the progress is slow (it takes more then 4 minutes) and I am looking for fastern procedures. I will appreciate if any body help me.
Thanks


Code

Sub ImportTxt()

    Dim proddb1 As Database
    Dim MyRs As Recordset
    Dim f As Integer
    Dim MyStr(21) As String
    Dim MyFld As String

    Set proddb1 = OpenDatabase("e: empdbtmp.mdb")
    Set MyRs = proddb1.OpenRecordset("select * from datasheet", dbOpenDynaset)
    For j = 0 To MyRs.Fields.Count - 1
     MyFld = MyFld + "," + MyRs.Fields(j).Name
    Next j
    MyFld = Right(MyFld, Len(MyFld) - 1)
    MyRs.Close

    f = FreeFile
    counter = 0
    Open "e: emp10-2.mgd" For Input As f

    Do While Not EOF(f)
        Input #f, MyStr(1), MyStr(2), MyStr(3), MyStr(4), MyStr(5), MyStr(6), MyStr(7), MyStr(8), _
        MyStr(9), MyStr(10), MyStr(11), MyStr(12), MyStr(13), MyStr(14), MyStr(15), MyStr(16), _
        MyStr(17), MyStr(18), MyStr(19), MyStr(20), MyStr(21)
        StrValues = ""
        For i = 1 To 21
         StrValues = StrValues + "," + Chr$(34) + MyStr(i) + Chr$(34)
        Next i
        StrValues = "10-2" + StrValues

        strSQL = "INSERT INTO datasheet (" & MyFld & ") "
        strSQL = strSQL & "VALUES(" & StrValues & ") "

        proddb1.Execute strSQL
        counter = counter + 1
    Loop
    MsgBox counter & " Records Imported"
    Close #f
    proddb1.Close
End Sub

Problem With Compare Two Large Text File
I am wondering is there a way or different method to compare two large text file without taking up so much time. I tried the FC.exe command and it did it very fast, but when I try to compare it in my VB program, it takes forever to finish with following code.

open FN1 for input as #1
while not eof(1)
line input #1, Str1
open FN2 for input as #2
do while not eof(2)
line input #2, Str2
if (Str1 = Str2) then
bfound = true
exit do
end if
loop
wend

Thanks you in advance

Sorting Large Number Of Large Text Files
Hi,
I have around 500 text files (csv format). Each file is ca. 5MB and sorted by a timestamp. my application needs to playback all these files line by line but sorted by time.my goal is not to put all files in memory, use a sorting algorithm, create one sorted output file and then read from the output file.
I am rather thinking of sorting the files as they stream. For this I would only need to know in each file the time stamps of the current lines and compare them to each other.
what is the best way to do this? any ideas?
thanks

Sorting A Large Text File ..... Waves To Hack :)
Based on the other thread with the same name which is marked as reolved ...

I'm now using this Quicksort routine to sort a text file thats nearly 2 meg in size.
It contains fixed length records.
I towkred before, but now the file is bigger I am getting "Input Past End Of File" error messages on the line of code highlighted below.
Anyone know why ?


VB Code:
' Now sort file into alphabetical order    Open "C:att_value.txt" For Input As #1     [b]str1 = Split(Input$(LOF(1), 1), vbCrLf)[/b]    Close #1        QuickSort str1, LBound(str1), UBound(str1)        Open "C:att_value.txt" For Output As #1     Print #1, Join(str1, vbCrLf)    Close #1

Splitting A Large Text File... Or Searching Contents?
Hi all. I've been beating down the search function attempting to find the cleanest (and more importantly, easiest) method to read a large text file with a few hundred records and multiple fields per record.

I had originally decided to type in the first field (name), then execute a search through the records till the name was found, then assign variables to each field of that particular record. Now, I think I'm switching to a combo box drag-down list that displays only the first field of each record. My problem comes in sucking in all that information for the combo box, while still maintaining the variables for the other fields.

Let me give an example:

(Contents of my text file)
Bob Ward,15,BobWard.wav
John Thompson,31,JohnThompson.wav
Steve Kirk,16,SteveKirk.wav
Heather Sparks, 15,HeatherSparks.wav

Initially, I would have typed "Bob Ward" in, and search for an instance of that name in the text file. If Bob Ward wasn't found, the program would simply move to the next step. (This will happen throughout). Now that I'm typing this, it seems like that may be the way to go anyhow- as any record NOT found in a Combo Box I'll need to add anyhow... and that will require more coding.

Regardless, I was planning on pulling in the data, splitting it by vbCrLf into one group (records) and splitting it by comma for the other group (fields). In fact, I've already done this on a much smaller scale 12 record .txt file, and it works perfectly. However, with the much larger file, that would require a lot more lines of code the method I used... not an impossible task, but it would require more coding if I even decided to add more records. (I wasn't doing for I.. next I, rather just naming record1-12 as seperate arrays)

This post may be confusing, but I've been trying to structure my thinking so as not to waste coding time later. Any advice at all will be appreciated, and I am by no means a VB professional, rather just a hacking amateur.

Thanks in advance!

Importing A Very Large Text File In A String Variable
Hello friends...

I'm having an urgent problem here; I'm trying to import a very large text file of +54 MB(!!) into a String variable but each time the machine crashes...

Does anyone know what the problem is? Normally seen a string variable can contain up to 2 billion characters (says the VB Help)...

PS. It works fine with large files of 10 to 20 MB.
PPS. The machines who need to process those files are Pentium III's with 128 MB internal memory...

Here's the code I use in my program:

====================================

Public Function ImportFile(iMessage As Integer, Optional ByVal fLatestFile As Boolean = False, _
Optional strFileName As String) As String

Open sFileName For Input As #1
ImportFile = Input(lLength, #1) -> Crash!
Close

====================================

lLength contains a value like this = 55000000

Is it crashing because of a memory-overflow?

Please help Me if You know a solution for this...

Thank You

Bart

I Need Help Reading From A Large Text File, And Rewriting Each Single Word
Here's what I have. I have a large text document with all the 5 letter words. I've attached the file so people can see. I got the list from an online dictionary.

Now - it seems to be broken up by space. So it's a word, then a space, then a word, then a space, word, space, etc, etc. From A-Z

Now - what I need help doing is opening the file (no problem), then reading each word one by one and adding it to a premade text file named Letter.txt (where the letter is the first letter of the word).

So - basically I want it to open the file, read the first word and toss it into the A.txt file, then the next word and toss it into the A.txt file, when it gets to B it throws those words into the B.txt file.

I can only seem to read the file as one long string when I try to read it, so I'm having trouble with that.

I could just copy all of the A words to the text file, and then manually seperate each one on its own line - but that would take a lot of time.

How To Read A Large Amount Of Plain Text Into An Application From A File?
Hi,

I have the user click on a number of labels which are all in a control array whatis(). When a user clicks on a label, I want the appropriate and corresponding file to be opened and read into the memory a few bytes at a time.

My current code is as follows, (the array means I don't have to have a different file open function for every label.

My problems are described below the code


VB Code:
Option ExplicitDim helpfilename(20) As String Public Sub whatis_click(index As Integer)Dim helpno As Integer helpfilename(0) = "whatdoesthisdo.txt"helpfilename(1) = "whomadethis.txt"helpfilename(2) = "whatisencryption.txt"helpfilename(4) = "whatisdecryption.txt"helpfilename(5) = "howdoesitwork.txt"helpfilename(6) = "howsecureisit.txt"helpfilename(7) = "useitfor.txt"helpfilename(8) = "discloseinfo.txt"helpfilename(10) = "legalegit.txt"helpfilename(11) = "upgrade.txt"helpfilename(13) = "modifyprog.txt"helpfilename(14) = "troubleshooter.txt"helpfilename(16) = "howdoiuse.txt"helpfilename(17) = "faq.txt"'Code here to read in an appropriate text file a few bytes at a timeEnd Sub


The index is of course the index of the label within the control array. Each index number in the array above corresponds to the file that should be opened for the index number of the label that was clicked in the control array.

What would be the best way to:
Read the corresponding file into memory without overflowing the memory or the variableRead it in only a few bytes at a time (each text file is a large passage of text equating to around 2kb to 10kb).

Many thanks,

Jord

Problem Retrieving Large Text Data From The Excel File
Hi
I am trying to retrievd data from the excel file using ADO and updating the SQL aerver based on that.
My problem is that the code is giving error for any column which has a large text data.
Please help me what i need to do.
the connection that i am establishing is as:

cn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & _
Trim(strFilePath) & Trim(strFileName) & _
";Extended Properties='Excel 8.0;IMEX=1;FMT=Delimited;HDR=Yes;MaxBufferSize=2048;PageTimeout=5'"


cn.Open

rs.CursorType = adOpenDynamic
rs.CursorLocation = adUseClient

Convert Large Binary Files (3270 Exports) To Text File Format.
Access XP doesn't appear to import Binary files when exported directly from Attachmate.
Some of these files are quite large 18mb - to 100mb.

When I attempt to open the files in Access XP they fail and lockup Access XP. I have looked at the file format with some Hex compare utilities and they report that the file is 'Binary'.

If I take the same exact file and open it in Notepad then click save the file date and time changes and the file works perfectly with Access XP. (And the HEX compare utility no longer indicates that the file is binary)

Now that I am aware of this limitation - How do I take the file called XYZOutput.txt - open it in VB with FSO and write it back out as the same file name?

My theory was - If I can open the file in notepad - make NO CHANGES - but click 'SAVE' - the file structure changes from binary to text.

I have the following code to open the file and close it - but in VB it does not change the structure the way notepad.exe did?

One catch - the routine needs to handle large files, and since they are large I don't want to make a second file. I don't know what the file size limitation is of Notepad.exe. I want to fix the broken file. So for example - If my file is called "XYZOutput.txt" I want the VB routine to open this large file 'fix the formatting from binary to text' and save it.

'' Code ----------------------------------

    Dim fso As FileSystemObject
    Dim fil As File
    Dim ts As TextStream

    Set fso = CreateObject("scripting.filesystemobject")
    Set fil = fso.GetFile(sourcefile)
    Set ts = fil.OpenAsTextStream(ForAppending)
    ts.Close
    Set fso = Nothing
      
Kramerica

SQL And Large Sections Of Text
I need to insert 'summaries' of an incident into my database. My first thought was to create a very large text field. My instinct from VB is that you shouldn't create a large field because it maintains that space for each record whether the text is there for not. Am I correct?

What is the best way to store paragraphs of text (such as what I'm typing in this post) in SQL?

Thanks!

Insert Large Text In Db
Hi ,

I want to insert large text in a particular field of mdb database. I creating a table dynamically in VB6.

Now what should i keep the type for that field. I mean text or memo.

In case of memo does data needs to be saved or loaded using special commands or what. I am having some problems storing text in memo. only small part of text is stored and when i insert few records in db then some blank records also gets inserted.

I would be grateful if anyone would help me out.

Thanks,
Greatchap

Large Amount Of Text...
Hi!

I am working on a Document Manager application. I want to be able to indexing the word documents, and use


Code:
Set wdApp = CreateObject("Word.Application")
vDocument = Trim(Text1(1).Text)
Set wdDoc = wdApp.Documents.Open(vDocument)
Ltext = Trim(wdDoc.Range.Text)
frm_Doc_Library.Ado1.Recordset!IndexContent = Ltext
wdApp.Quit
DoEvents
Set wdDoc = Nothing
Set wdApp = Nothing

But in SQL Server, looking at the field IndexContent it just says <Long Text>.

What Im I doing wrong? It doesn't matter if IndexContent is nChar or Text.

Please help me, because Im lost! :-(

Large Text Parsing
I need help parsing through a heavy bit of text, here.

I need to parse through lines like this:

('1', '6', '', '0', 'Name', 'VALUE', '2006-06-12', 'email', '4', '', '', '', 'yim', '', 'address', 'aim', '1', '1', 'The Dogs Bollocks', '0', '1150125120', '0', '1155507211', '1155508600', '1155497659', '319', '10', '1', '0', '1', '0', '10', '0', '2263', '09-27-1989', '1989-09-27', '-1', '1', '', '0', '0', '0', '0', '-1', '48', '15', 'val', '0', '0', '0', '0', '0');

The bolded parts are what I need outputted, perferably into a format like so:
Name:Value:Val

Also -- there are multiple lines of code. Each one is on a new line. When the parsed text is outputted, I'd like it to be on seperate lines as well.

I've attempted this a few times, to no avail. Help?

Large Amount Of Text
I have a rather large bunch of text I want to put into a box of somesort that has a vertical scroll bar. What I am doing is creating a EULA and want to have in on the 'About" page of the program I am writing. I have looked at the list box but cannot seem to get anything thing to work. I have tried the combobox which I can't seem to get anything to work with that either. You should be able to tell I am rather green to this VB stuff but am learning via this poroject and all the help I have had so far from all of you.

Any help with this would greatly be appreciated. I just want this Textbox as it were to popluate with this entire EULA which would need to scroll as it is very large.

Thanks in advance.

Large Amount Of Text
I have a large amount of text in the beginning of a document that i want to cut out, is there a way to say take out anything before a certain word?

Large Text Files
I am writing an interactive story program, and need to insert the users name and a friends name into the story. I don't have to write the story in a module to get the program to insert "strUser" and "strFriend" into the story do I? Can I put the story in the same directory as the program. The main problem is there will be a lot of different stories and one story in a module is hard enough to proof.

Very Large Text Lookup
I am writing a VB.NET application that uses two text files. The first contains a column of last names, and a column of 3 digit numbers (padded with spaces as necessary to ensure fixed width format) - this is the 'person file'. The second text file contains a map of the 3 digit numbers to a department name - the 'mapping file'. It is a simple program that I've gotten to work when the numbers are small but I need it to work for a person file with up to 500,000 rows and a mapping file of 100,000 3-digit numbers.

My original program simply read in the first line of the person file, took the substring containing the 3 digit code and then did the same thing on the mapping file, row by row, and compared the two substrings containing the 3 digit code. If there was a match it would output the person name and the department name to a third file. That worked up to about 5,000 rows on the person file and 1000 rows on the mapping file. I've tried variations by storing the mapping file in an array or a structure within the Load event handler but then the application times out during the load phase.

Any Ideas?

Large Number Of Text Boxes
Hi everyone. This is my first post to the forum, which i've found to be of great assistance already.
I'm writing a DB frontend that pulls names from a table and then using a dynamic control array creates a text box for each. This ends up as a scrollable list of all the names in the text boxes. Obviously, you could end up with a lot of text boxes and even though this gets around the limit on the number of controls on the form, I'm not convinced this is the best method.(ie. memory usage etc)
Does anyone have any suggestions or opinions on the way to go here?

Appreciate any comments.

Cheers

PS. Using VB6

Make Text As Large Without Wrapping
Hi there,
I have a project I am working on where i need to open up a word document, change one line of text and then print it automatically. That all is working fine, except I need to figure out a way to resize that one line of text so It is as big as it can be without wrapping to two lines (font sizes in the 150's)

ANy ideas?

Need To Search LARGE Text Files
Hello, I have a unique problem here at work where we started getting customer data in in ascii txt file format. The problem is - It contains information the belongs into 2 different databases. What I need to do is search the main txt file and PULL out the information on customers that have a specific code here is a snippet from the text file:


PT NAME PATIENT NO PT FC REP RC REASON PRODUCED HOSP PAGE
MACCLELLAN ,MARTA 1053484-0 G 2 000 I RQST MBD 10/17/01 S0KG 0001
ADM 06/19/01 MR# 00122168 BD 06/14/51 SEX F SS# 123-12-1234 DISP HR
DSCH 06/20/01 DR DAVIS, J KENNETH MAR ST MARRIED
______________________________________________________________________ _________
GUARANTOR# 296502626 PH1 330 325-1057 PH2


In the 1st line there are sever headers the one of interest is RC
The second line contains the information that the headers represent the info of interest here is the letter I

each section of the text file has information of that particular person and can vary in length/lines.

When I open the file with DOS's edit each section appears to be seperated with what looks like the symbol for "women" which i believe is the same thing as th vbNULL char.

File Specs:
Type: ASCII Text
Size: 3125KB



I attached a test file that contains the first persons information as to give you some sort of Idea on the layout

View Large Amount Of Text
I create a large list of data, and try to display in a textbox.
Unfortunately it only seems to allow around 32k on text.
Can I write it to a file and view it some other way or something.

Any help would be most apreciated.....
D

Reading A Large Text Field
Hi,

I'm having trouble reading a large varchar field from an SQL 2005 Database into a form in Access. I've been using the function below but just discovered that with large fields its only getting part of the field. I've done some research and i think I need to use the GetChunk method. I can't find any documentation on using it for this purpose. When I've tried I've been told that I cannot use the method in "this context".


Code:
Private Function UpdateScript(intPoint As Integer)
Dim adoData As ADODB.Recordset, ContactRec As Integer, txtLabel As String

Set adoData = CreateObject("ADODB.Recordset")

adoData.Open "SELECT pointtext FROM dbo_Script WHERE ScriptID = " & txtScript.Tag & " and PointID = " & Me.Controls(txtLabel & intPoint).Tag, Application.CurrentProject.Connection, adOpenStatic, adLockReadOnly

txtScript = adoData.Fields("pointtext")

adoData.Close

End Function
Another forum tells me to use something like
Code:
While {I can't remember the condition}
strMyData = strMydata & adoRS.fields(1).Getchunk
Wend
But I'm finding that a little too vague.

Is anyone able to provide some insight?

Thanks,

Cameron

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