underthewood
Programmer
- Nov 8, 2010
- 4
Hey, I was wondering if I could get some help with the following. I have 2 seperate tet files listing columns of the same data but in a different format. Here's an example of how the same data is displayed in each file:
SINGLE COLUMN
v1v2v3
000
001
011
111
THREE SEPERATE COLUMNS
v1 v2 v3
0 0 0
0 0 1
0 1 1
1 1 1
So in the single column regime three digits make up a number, and in the second file three seperate integers are displayed, which correspond to the same order of the digits in the other file.
Now I can do one of two options. I can either seperate out the the digits in the first file into 3 columns, or I can combine the integers in the second file, just so I can get both in the same format.
Ive already attempted to do the latter method, by having something like VT= (100*v1)+(10*v2)+v3. The only problem with this is that if I have VT as an integer type, any preceding zeros I should have are ignored, and i need it in the v1v2v3 format (ie no double precision either).
How do I remedy this, or, alternatively is the other method easier?
Also, there are only ever 3 digits, which may be worth you knowing.
Cheers
Dan
SINGLE COLUMN
v1v2v3
000
001
011
111
THREE SEPERATE COLUMNS
v1 v2 v3
0 0 0
0 0 1
0 1 1
1 1 1
So in the single column regime three digits make up a number, and in the second file three seperate integers are displayed, which correspond to the same order of the digits in the other file.
Now I can do one of two options. I can either seperate out the the digits in the first file into 3 columns, or I can combine the integers in the second file, just so I can get both in the same format.
Ive already attempted to do the latter method, by having something like VT= (100*v1)+(10*v2)+v3. The only problem with this is that if I have VT as an integer type, any preceding zeros I should have are ignored, and i need it in the v1v2v3 format (ie no double precision either).
How do I remedy this, or, alternatively is the other method easier?
Also, there are only ever 3 digits, which may be worth you knowing.
Cheers
Dan