473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Parsing a text file

I have the task of documenting about 80 different databases, I have mapped all the linked tables and host tables, in Visio with reverse engineering. Now I have to parse the code for all imports and exports and such. I have already extracted all the VBA code to .txt files and have condensed them to one file per database. Now I want to loop through the code to retrieve only the lines where, “acExport” is in the string, and hopefully return, DoCmd.TransferSpreadsheet acExport, 8, "qry Manual_Item_Adds", "Path&File", True, ""
The acExport string will be a variable, but that should be a good example.

As of right now, I get a line by line return starting at the first line.

Thanks

Andrew

Expand|Select|Wrap|Line Numbers
  1. Public Function fnFindText(foldername)
  2. Dim strSrTxt As String
  3. Dim A As String
  4. Dim fso As Scripting.FileSystemObject
  5. Dim f As Scripting.TextStream
  6.       strSrTxt = "acExport"
  7.  
  8.                Const ForReading = 1
  9.  
  10.          Set fso = CreateObject("Scripting.FileSystemObject")
  11.          Set f = fso.OpenTextFile("XXXXX\Database Extracts\zzzMaster Code Files" _
  12.  & "\" & foldername & " Master.txt", ForReading, True)
  13.          Do While f.AtEndOfStream <> True
  14.             A = f.readLine
  15.            MsgBox (A)
  16.               If InStr(A, strSrTxt) <> 0 Then
  17.                boolStFnd = "True"
  18.                fnFindText = "Text found"
  19.  
  20.          Exit Do
  21.             End If
  22.          Loop
  23.          If boolStFnd <> "True" Then
  24.             fnFindText = "Text not found"
  25.          End If
  26.          f.Close
  27.         fnFindText = "File does not exists"
  28.  
  29.     End Function
  30. 'Path to write temp files for extract into Visio
  31. ''''XXXXX\Knowledge base\Database Extracts\zzzMaster Extract Transfer
Dec 28 '10 #1
1 2702
Ok, I got it to work, I Commented out lines 16,17 and moved a 15 to line 19.
Dec 28 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Joey Martin | last post by:
I have been reading documentation on parsing. I need some help though. I have the following in a text file: $650 Number of Bedrooms 3 Air Conditioning? Yes Original Ad SOUTH, 3BR, air, basement....
5
by: SROSeaner | last post by:
I have a text file that is the result of using XMLHTTP object to pull back a page of search results from a search engine. So I have the entire results page in HTML, and want to break out each hit...
4
by: Hugh | last post by:
Hello, I am having some problems understanding (most likely), parsing a text file. I would like to parse a file like: block1 { stuff; ... stuffN; };
11
by: .Net Sports | last post by:
In VB.net, I'm trying to do a couple of things in a couple of different blocks of code. I need to take the first 25 characters of a text file, then append at the end some ellipses and a MORE link...
6
by: kevin | last post by:
I need to parse an third party supplied delimited or fixed width text file into a datatable. The delimiter may vary. I am currently using a SteamReader to read each line and, for delimited...
4
by: thenewuser | last post by:
Hi all, I am working on windows 2000 and using php 5.0 and apache 2.0.59. I am facing a problem while parsing a text file.Actually I am using a pop server for parsing an email.I am downloading...
2
by: DCDeshpande | last post by:
Hi, I am new to Java and need to parse a simple txt file into unique tokens and store them in a data structure. Can someone please recommend the most efficient way to do this? I found out that...
2
by: python | last post by:
I'm parsing a text file for a proprietary product that has the following 2 directives: #include <somefile> #define <name<value> Defined constants are referenced via <#name#syntax. I'm...
2
by: sevak316 | last post by:
Hello, I stored a text file into an array. Now I am going through the array looking for a particular string. When I find that string, I want certain things that come after it to be stored into a...
18
by: lka527 | last post by:
In the code, I have bold text where I have a question. I am not sure how to parse the file into different fields (right below with bold: machine,plan,study,scantype, date)... and I have more...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.