Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Need help to read data from a text file

Hi,

I have a data which is poorly organized on a text file (it was taken
out from a very old computer when we did lab experiments). However, I
can you this. There is a 2 conseqent rows of data (2nd row of data is
not important) in which I only want the code to read the 5th number of
1st row and insert that value in excel. The value consists of about 2
digits and 12 decimal places. I would appreciate if anyone can make a
code to read from the text file and copy the 5th number from this file
and insert it in excel vertically. I don't have a very good VB
experience but i have come across some good VB programmers and I would
like to give them the opportunity to solve this problem. I can send
this text file to you if you want to try. Please give me your email
address and I'll send it to you.

Mahadevan Swamy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Need help to read data from a text file

G'day Mahadevan

Take a look at the following link

http://www.rondebruin.nl/txtcsv.htm

The code will do pretty much what you need.

Where the code states this

..TextFileStartRow = 1

change it to

..TextFileStartRow = 5

Assuming the TXT file has no header row, if so, then your row start would be
6.

HTH
Mark.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Need help to read data from a text file

Hi,

Thanks for your help. I tried the macro and your suggestion and i find
that there is a poor organization of data. The numbers are all over
the place in excel spreadsheet and this doesn't give me what I need. I
tried the second suggestion on the website which is txt files with a
Fixed Width but the problem is some of the numbers on some rows has a
fixed width while other rows doesn't have fixed width. The criteria i
want to put in the code is in every 1st row of the data, the 5th
number has to be read and put in a spreadsheet. I can send you the
file that has the data so you could analyze and tell me what
components to correct in the code. Let me know if you want to do that.
Thanks

Mahadevan Swamy
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Need help to read data from a text file

Does anyone have a solution to this problem? Thanks

On Jul 23, 9:50 pm, Harish wrote:
Hi,

Thanks for your help. I tried the macro and your suggestion and i find
that there is a poor organization of data. The numbers are all over
the place in excel spreadsheet and this doesn't give me what I need. I
tried the second suggestion on the website which is txt files with a
Fixed Width but the problem is some of the numbers on some rows has a
fixed width while other rows doesn't have fixed width. The criteria i
want to put in the code is in every 1st row of the data, the 5th
number has to be read and put in a spreadsheet. I can send you the
file that has the data so you could analyze and tell me what
components to correct in the code. Let me know if you want to do that.
Thanks

Mahadevan Swamy


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data from exported file read as text, when edited becomes a # (pic Jarod Excel Discussion (Misc queries) 1 July 1st 09 02:21 AM
How do you save an excel file to be read as IBM-type text file ? Dee Franklin Excel Worksheet Functions 2 October 10th 06 02:46 AM
read text file hallie Excel Programming 2 August 17th 04 01:00 PM
read text file hallie Excel Programming 1 August 17th 04 12:37 PM
Read data from a text file (*.txt) Adrian T Excel Programming 0 June 4th 04 10:00 PM


All times are GMT +1. The time now is 11:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"