473,406 Members | 2,705 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,406 software developers and data experts.

How to extract text data from notepad using access vba 2007

i want to extract text data from notepad file using access vba 2007 .....


can any body tell me how to do this


please give me sample examples if anyone have.



thanks...
Aug 13 '12 #1
6 6198
zmbd
5,501 Expert Mod 4TB
@prasad joshi

Welcome to the bytes forum!

Would you please review your question and provide more detail as to what it is you're having issues with?

We'd also like to see any code that you may have already attempted; however, please remember to enclose the code within the [code] [/code] code tags.

Without any further information as to the structure of the file you're trying to import all I can offer is the following:
http://office.microsoft.com/en-us/ac...101790599.aspx
http://msdn.microsoft.com/en-us/libr.../ff835958.aspx

Before you re-post your question, would you take a few moments to review the following:

This is a must read!!! Posting Guidelines


How to ask good questions

FAQ

Some other generally helpful links:

I’ve found that all too often the textbooks really do a very poor presentation of the actual steps behind setting up a database from scratch. However, I have found a really good step by step tutorial for basic design here:

A Tutorial for Access

Although this may sound a tad late for your current project, this tutorial may yet give you some insight to any issues you may run into with your project in the near term and should help you with any future projects.

Of particular note is >> tables <<page within the tutorial - notice the information that is given, the table name, the field name, the field type, key or index, etc... AND the format used to present that data.

When you post back, this is the type of information we'll need to help you along in your project. You don't need a fancy grid table to do this... just a line by line layout.

One of the hardest concepts for most people to understand is that of "normalization." I found this link to have a really good really good explanation of the concept for those just starting out and I found it to be a good review when I read thru it:

Database Normalization and Table Structures.

Looking forward to helping you with your project...

-z
Aug 13 '12 #2
i have note written any code I am totaly new
Aug 13 '12 #3
zmbd
5,501 Expert Mod 4TB
Then start with the two links provided to MS in my post.
If those links do not help you develop a starting code, then we will need to understand what information is in the text file and how it is structured.

-z
Aug 13 '12 #4
ADezii
8,834 Expert 8TB
Notepad produces the simplest of all Text Files, the contents of which can easily be extracted and analyzed by any number of Methods. The following Code will Read each Line of a File produced by Notepad, Parse the contents of each Line, then Write the Results to the Immediate Window.
Expand|Select|Wrap|Line Numbers
  1. Const conPATH_TO_FILE As String = "D:\Test.txt"
  2. Dim strLine As String
  3. Dim varLineContents As Variant
  4. Dim intCtr As Integer
  5.  
  6. Open conPATH_TO_FILE For Input As #1        'Open file.
  7.  
  8. Do While Not EOF(1)                         'Loop until end of file.
  9.   Line Input #1, strLine                    'Read line into variable.
  10.     varLineContents = Split(strLine, " ")   'Parse Line contents using a Space
  11.                                             'as the Delimiter
  12.     For intCtr = LBound(varLineContents) To UBound(varLineContents)
  13.       Debug.Print varLineContents(intCtr),
  14.     Next
  15.       Debug.Print vbCrLf
  16. Loop
  17.  
  18. Close #1    ' Close file.
  1. The File D:\Test.txt:
    Expand|Select|Wrap|Line Numbers
    1. SHE SELLS SEA SHELLS AT THE SEA SHORE
    2. Hello World
    3. Beauty is in the eyes of the beholder
    4.  
  2. OUTPUT to the Immediate Window:
    Expand|Select|Wrap|Line Numbers
    1. SHE           SELLS         SEA           SHELLS        AT            THE           SEA           SHORE         
    2.  
    3. Hello         World         
    4.  
    5. Beauty        is            in            the           eyes           of            the           beholder      
    6.  
Aug 13 '12 #5
this program dont give any output
Aug 14 '12 #6
zmbd
5,501 Expert Mod 4TB
Prasad;

As I have indicated in another thread that you started, You usually will not get a completed code provided to you unless you have posted what you have already tried.

This is a basic I/O homework style question asked in every Computer Science class I've ever taken... from highschool thru college.

Please post the work you already have undertaken or avail yourself of the information I and ADezii have proveded.

Use the external data emport from the ribbon
Use the transfer method
Open a file for input using the standard BASIC i/o commands

-z

@ADezii: code work exactly as described in the post in my test database... :) )
Aug 14 '12 #7

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

Similar topics

4
by: RK | last post by:
Hi, In my application, I need to copy data from an Excel file into a SQL table. The article related to this can be found at http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B306572 ...
5
by: Michael Hill | last post by:
Hi, folks. I am writing a Javascript program that accepts (x, y) data pairs from a text box and then analyzes that data in various ways. This is my first time using text area boxes; in the past,...
6
by: MLH | last post by:
I would like a scanner - something like a pencil that would allow me to attempt to scan printed text off hardcopies. Not all text on a page, mind you. Something I could use to scan just the words...
8
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I...
0
by: kunal | last post by:
I am developing a web based application in which i give an option to the registered users of the applications an option to upload files as attachments directly in the blob field of the database....
1
by: shaguna.dhall | last post by:
I need to migrate Unicode data from MS Access to Oracle. Have tried the following: -Exported the Access tables to csv/txt, but these files were generated in ANSI encoding, and the Unicode data...
0
by: selacika | last post by:
Hi all; My question is about how to get non-font information part of a field of text data type using an sql sentence. Shortly how to get pure info from a text data type field. Example: Value of...
5
by: Bluecove | last post by:
After many unsuccessful attempts at this, including the use of software from Sobolsoft, I need help! I have a table comprised of thousands of long records (all in one column which is Memo type)....
1
by: ankurgupta76 | last post by:
Hi I have a restaurant billing software developed in vb 6 and ms access db as backend. now for old data i have created another copy of db and called it the master db. So periodically i need...
6
by: pagoto123 | last post by:
hello.. i need to read picture or notepad from access database .. i make the access column a ole object i put the photo but when i photo.text = myreader(1) then it says conversion from byte to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.