What if I have this case:
Code:
cmg_number|cmg_name|cmg_description
1|Self Management|
2|Relationship Management|
3|Communication|
cmp_number|cmp_competency|cmp_shortText|cmp_description
1|Self-Development||Test.
2|Adaptability/Stress Tolerance||Cool.
3|Self-Control||Thanks.
4|Trustworthiness||Living.
And should be changed to this:
Code:
cmg_number|cmg_name|cmg_description
1|Self Management|
2|Relationship Management|
3|Communication|
cmp_number|cmp_competency|cmp_shortText|cmp_description
1|Self-Development||Test.
2|Adaptability/Stress Tolerance||Cool.
3|Self-Control||Thanks.
4|Trustworthiness||Living.
Rule: Between
3|Communication| and
cmp_number|cmp_competency|cmp_shortText|cmp_descri ption, there should be a NEW LINE to separate new header
Actually I have this code to check if the line has string or not, if not then I have to remove that new lines.
PHP Code:
'open the file for verifying
dim fso, fsoIOMode, fsoCreate, fsoFormat, fsoTextStream, line
set fso = server.createobject("scripting.fileSystemObject")
fsoIOMode = 1 'for reading only
fsoCreate = false 'do not create a new file
fsoFormat = -1 'unicode
set fsoTextStream = fso.openTextFile(file.path, fsoIOMode, fsoCreate, fsoFormat)
do while not fsoTextStream.atEndOfStream
line = fsoTextStream.readLine
'check if the line has no string
if line <> "" then
response.write fsoTextStream.line & ": " & line & "<br />"
else
response.write fsoTextStream.line & ": " & "none" & "<br />"
end if
loop
Now my problem is to check between the header and the last string from above, that there should one new line of that.
Let me know if how will I do that... Yeah, your solution is really great, I will follow it.
Thanks