I want to dump [3-4 lines together] some data to an excel sheet.
I could able to dump single line based on some criteria [like if line is getting start with // or /* ], but in case of when lines starts from /* and after 3-4 sentences its end with * / .
Only first line which is started from /* and last line which is ended with */ could able to dump.
I'm unable to handle this situation, please help.
Below is my code:-
fileopen = open("test.c")
for var in fileopen:
if var.startswith("//"):
var1 = var1 + var
continue
if var.startswith("/*"):
var1 = var1 + var
continue
else:
continue
worksheet.write(i, 5,var1,cell_format)
Note:- Above code will be having indentation issue. As i don't how to put the code properly in stack over flow, so please ignore this issue.
For example:-
/* Test that the correct data prefetch instructions are generated for i386
variants that use 3DNow! prefetchw or SSE prefetch instructions with
locality hints. */
I want to dump entire data at once through python script but i could able to dump only "First Line", which is started with /*.
Any suggestion please!!!
Thanks in Advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…