[RESOLVED] Selecting Column and position to read data from
Hi,
I would normally select the column I read data from - strline(3),
and where I start reading in a string from - Mid (sLine, 12, 10),
How do I combine the two?
And to further complicate it, the length shown here (10) will vary in length and I want to concatenate another column on the end - & " " & Trim(Strline(4)).
Thanks
Re: Selecting Column and position to read data from
Can you provide more details with examples and the code you are using....? ... :wave:
Re: Selecting Column and position to read data from
I'm not sure my coding would help (its that bad),
Basically data in
Column 2 is: 123......ABC;
Column 4 is: XYZ;
Both columns declaired as strings,
I want to take the ABC out of column 2 anc concatinate the XYZ on the end.
Previously if I wanted data input from column 2 it would be using
.Answer = strline(2)
Which would input everything in the column, but this time I want to only include from char 10
And I would repeat this in a loop of +1 till the end of file
Or if I wanted to read data from a string starting at a certain place it would be
.Answer = Mid(sLine, 15, 3) 'Assuming the XYZ started at the 15th character
And again repeat till end of file.
Looking to mix it so this time:
.Answer = Trim(strline(2), sline, 10) & " " & Trim(strline(4)) 'Assuming XYZ is in column 4
And again loop with +1 till end of file.
Does that make sense or have I made things worse???
Thanks
Re: Selecting Column and position to read data from
Are you using a Listview...??? Or a String array, where all the lines will be stored...???
Mid(sLine,15) --> This will give you the string starting from the position 15 till the end of the line. ...:wave:
Re: Selecting Column and position to read data from
Thanks for your help, this gives me the answer. It was just trying lots of things till I found the result. This starts from the 15th character of the second column.
.CatCode = UCase(Mid(strline(2), 14) & " " & Trim(strline(10)))
Thanks