Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get data out of text-file into excel

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
I've a textfile containing the the following data:
The content is varying but the section are always the same...
**********************************************************
no comments

[Measure data]
Name=Customer
LIMS nr=0.000000
Acc. Voltage (kV)=0.000000
Sample Current (uA)=0.000000
Crystal=PET
Element=Mo
Start (A)=1.000000
Stop (A)=0.000000

[settings]
mean over#=50
Sample Rate=100.000000
physical channels=Dev1/ai1
Input range=1.000000
Visible records=600

[Data]
0.00E+00 1.05E+00
5.00E-01 1.05E+00
1.00E+00 1.05E+00
1.50E+00 1.05E+00
2.00E+00 1.05E+00
2.50E+00 1.05E+00
...
...

*********************************************************

I want to get the columns at the bottom in a Excel-chart.
How do I select the data in the columns by using a macro.

The algoritme must be something like:
Find "[Data]"
Select the next cell-area until blank cell is found.
Copy to new sheet.
 



Please post VBA (macro) questions in Forum707

Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 
Without VBA it would go something like this:
Open the file in Excel

Find the relevant section
Edit,Find [Data]

Select the Current Region (bounded by blank rows & columns)
Edit, GoTo, Special, CurrentRegion

Split it into columns
Data, Text to Columns....

Name the Data Range (current region)
Use that name in creating your chart
OR
Copy it to a new sheet etc.

Get that to work without VBA then do it again with the macro recorder on. Tidy the code and post what you have and any issues in Forum-707

Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top