![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Read multiple integers from a line Topic Summary: Created On: 21-Feb-2006 20:16 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I have a text file that looks like this:
235 2004 104 221 990 488 Basically it's any number of lines, with 2 integers on each line. I want to create parallel arrays, one for each column. I tried something like this in a loop input >> array1 input >> array2 but it's reading down, i.e. 234, then 104, etc... How can I read across? I am using DOORS 6.0 SR1 |
|
![]() |
|
![]() |
|
I think you need something like attached.
You could also read the file to count the lines, declare the arrays, then reread the file storing them into arrays. - Louie |
|
![]() |
|
![]() |
|
You need to parse the line.
I won't repeat the code here since there are many examples of parsing a line within this forum and there are examples in the help file under Regular Expressions. |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Read multiple integers from a line
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.