Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default [/B] Problem: multiple DATA SERIES [/B]

I use some scientific instruments to collect data on a computer (man
different ones).

They all give data in a long TAB of CSV stream that looks like this i
Excel:
-
random info about the machine
may be several rows
or column in different cells*

X Y1
x y1
x y1
x y1
...*

more random info cells
gap (# of rows) between data sets is
usually constant/fixed.

X Y2
X Y2
X Y2
X Y2
...[/b]-


ALL THE X COLUMNS ARE THE SAME DATA. I REALLY NEED A WAY TO COPY EAC
SERIES OF Y DATA TO ADJACENT COLUMN SO IT WILL LOOK LIKE THIS
[b]
X Y1 Y2 Y3 ...
X Y1 Y2 Y3...
X Y1 Y2 Y3...
X Y1 Y2 Y3...
..

So that I can graph the data. There may be 50-100 series i
one file.

I've attached a very small example data file for furthe
clarification/convience.

This is a very common problem but I can't find any pointers eve
searching here. I tried it with macros, but I don't think I can do i
that way. Don't have a clue where to start, but I'll try anything.

Please give me some help if you can.

Thanks.

~K

Attachment filename: ps-ppv-2.txt
Download attachment: http://www.excelforum.com/attachment.php?postid=62710
--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default [/B] Problem: multiple DATA SERIES [/B]

From my brief testing this seems to work

Add a reference in the Excel VBE to the microsoft scripting runtime library.

Tim.



Sub ReadInfo()

Const RESULT_SHEET As String = "Sheet1"
Const FILE_PATH As String = "C:\local files\input_test.txt"
Const SEP As String = vbTab
Dim w As Worksheet
Dim sInfoStart As String, sInfoStop As String
Dim oFSO As New Scripting.FileSystemObject
Dim f As TextStream
Dim s As String
Dim iCol As Integer, iRow As Integer
Dim bInfo As Boolean
Dim a As Variant

sInfoStart = "VA" & vbTab & "IA*"
sInfoStop = ""
iCol = 1

Set w = ThisWorkbook.Sheets(RESULT_SHEET)
Set f = oFSO.OpenTextFile(FILE_PATH)

Do While Not f.AtEndOfStream
s = f.ReadLine

If s Like sInfoStart Then
iRow = 2
iCol = iCol + 1
bInfo = True
s = f.ReadLine
End If

If bInfo = True And s = sInfoStop Then bInfo = False

If bInfo = True Then
a = Split(Trim(s), vbTab)
If iCol = 2 Then w.Cells(iRow, 1).Value = a(0)
w.Cells(iRow, iCol).Value = a(1)
iRow = iRow + 1
End If

Loop

End Sub







"NoahMercy " wrote in message
...
I use some scientific instruments to collect data on a computer (many
different ones).

They all give data in a long TAB of CSV stream that looks like this in
Excel:
-
random info about the machine
may be several rows
or column in different cells*

X Y1
x y1
x y1
x y1
..*

more random info cells
gap (# of rows) between data sets is
usually constant/fixed.

X Y2
X Y2
X Y2
X Y2
..[/b]-


ALL THE X COLUMNS ARE THE SAME DATA. I REALLY NEED A WAY TO COPY EACH
SERIES OF Y DATA TO ADJACENT COLUMN SO IT WILL LOOK LIKE THIS
[b]
X Y1 Y2 Y3 ...
X Y1 Y2 Y3...
X Y1 Y2 Y3...
X Y1 Y2 Y3...
..

So that I can graph the data. There may be 50-100 series in
one file.

I've attached a very small example data file for further
clarification/convience.

This is a very common problem but I can't find any pointers even
searching here. I tried it with macros, but I don't think I can do it
that way. Don't have a clue where to start, but I'll try anything.

Please give me some help if you can.

Thanks.

~KC

Attachment filename: ps-ppv-2.txt
Download attachment:

http://www.excelforum.com/attachment.php?postid=627108
---
Message posted from http://www.ExcelForum.com/



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
How do I Generate Multiple Graphs for Different Series of Data MC_FRx_99 Charts and Charting in Excel 2 September 16th 09 09:19 PM
Displaying single and multiple data series.Single data series Donald Macleod Charts and Charting in Excel 2 January 30th 06 02:52 AM
Multiple data in series Ann Kelley Charts and Charting in Excel 11 October 5th 05 01:17 AM
Trendline and multiple data series Blackcat Excel Discussion (Misc queries) 1 May 2nd 05 02:06 AM
Problem in plotting data series on secondary axis Srinivas Reddy Excel Programming 1 April 7th 04 04:18 PM


All times are GMT +1. The time now is 03:35 AM.

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

About Us

"It's about Microsoft Excel"