Hi All,
I have a .txt file with data like following:
Student 1
name abc
age 12
section 123
Student 2
section 456
name xyz
age 13
Student 3
name dfg
age 12
section 456
My output file will be .xlsx file
student name age section
student1 abc 12 123
student2 xyz 13 456
student3 dfg 12 456
I am processing this file so that details of each student comes in each row in excel.
How can I put a flag or something to differenciate between student 1 from student 2? The data between Student is constant but sequence are changed. That is not a problem. I am unable to find a way to mark flags between the individual student!!
Need some help!!
Thank you..!! :)
What I have tried:
I am unable to think of a way to change flag even if I use it.
Here is my code:
while not EOF()
if instr(DataLine,"Student") > 0 then
student_val=DataLine
flag=true
end if
if flag=true then
if instr(DataLine,"name") > 0 then
name_val=rplace(DataLine,"name","")
end if
end if
wend
this gives values for first student. But when can I reset the flag to know that it is student2 in text file and start with new line in excel?