Hi,
I have a file of records of 4 fields each.
Each field is separated by a semicolon. That is
Filed1;Ffield2; Field3;Field4
But there may be also empty records such as
;;;;
(only semicolons).
For sorting I used
############### ##
lines = file('Config.tx t').readlines() # a file I want to sort
lines.sort()
ff=open('Config Sorted.txt','w' )# sorted file
ff.writelines(l ines)
ff.close()
###############
It was sorted but empty records were first. I need them to be last(at
the end of the file). How can I do that?
Thanks for help
Lad
I have a file of records of 4 fields each.
Each field is separated by a semicolon. That is
Filed1;Ffield2; Field3;Field4
But there may be also empty records such as
;;;;
(only semicolons).
For sorting I used
############### ##
lines = file('Config.tx t').readlines() # a file I want to sort
lines.sort()
ff=open('Config Sorted.txt','w' )# sorted file
ff.writelines(l ines)
ff.close()
###############
It was sorted but empty records were first. I need them to be last(at
the end of the file). How can I do that?
Thanks for help
Lad
Comment