borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Web Like)Next Topic (CD Ripping) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Need to get my .txt to a matrix
Poster Message
aAtU
Level: Guest


icon Need to get my .txt to a matrix

I have a problem, who doesn't..
Well, anyway, I need to get some data from various data files, they look pretty much the same in columns, but in rows they can have differences up to hundreds..
How do I read a specific column here, so I can use the math I need on this?

17-05-2004 at 03:05 PM
| Quote Reply
pavane
Level: VB Lord

Registered: 26-04-2004
Posts: 185
icon Re: Need to get my .txt to a matrix

Can you post an example of some sample rows from a text file?
This will help.

In many cases, the easiest way is to import into an Excel spreadsheet, and, if necessary, then save it as a CSV format file.

It is then easy to write VB or VBA code if Excel does not have the right functions.

18-05-2004 at 11:38 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
aAtU
Level: Guest

icon Re: Need to get my .txt to a matrix

I'm sorry about one thing, this is all about VBA in the end..
maybe wrong place to ask about it.. But the example..

time || data || status || time .... and so on for about 4-5 times..

How do I get the column with the data to some kind of variable, or something, so I just have to set up the equation? Then another problem appears, I must present the results as a diagram.. Can I take values and put them out in my word document simply by clicking the "run macro" button?
Anyone who knows?! It's for a schoolwork, forced to do it and don't know nothing about visual basic or VBA..

18-05-2004 at 12:22 PM
| Quote Reply
pavane
Level: VB Lord

Registered: 26-04-2004
Posts: 185
icon Re: Need to get my .txt to a matrix

I reckon you could probably do it just in plain excel. No need for scripts

OPen Excel
select Open file
Choose files of type : Text files in the dropdown
Select your text file (I assume it will have extension .txt)
The Text Import wizard is displayed.
Select Delimited (text option) & click Next

Check the 'treat consecutive delimiters as one' box
Type the delimiter character in the Other box

You will see the text in columns

Click Next
On the next page, you will be able to define the data type for each column, if necessary

Click finish
You will then have a spreadsheet with the data in columns.

19-05-2004 at 10:21 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
aAtU
Level: Guest

icon Re: Need to get my .txt to a matrix

that works, I know that much, it's just that i need to
automize it.. someway with variables because if I take the
spreadsheet, it's 10 col's and 1900 rows, and I need about 15-25 diagrams, my word file gets up to 30 mb.. thats why I need some kind of read and put out diagram stuff.. and I really don't know how..
It takes a day to complete a report if I do it by hand, with
snapping pictures out of excel and putting them into the report..

19-05-2004 at 12:34 PM
| Quote Reply
pavane
Level: VB Lord

Registered: 26-04-2004
Posts: 185
icon Re: Need to get my .txt to a matrix

You can use copy & paste to copy complete groups of columns directly into Word.

I can't see exactly what you are doing with the screen capture - is it the excel date or the diagrams (charts?)
or both?

Either can be copied and pasted directly rather than by screen shot, and will result in a smaller file.

21-05-2004 at 08:01 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Need to get my .txt to a matrix
Previous Topic (Web Like)Next Topic (CD Ripping) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder