Microsoft
Software
Hardware
Network
Question : skip the header when reading a file
Hi,
just a very short question
for line in open(file):
line = line.strip().split()
print line
But it's reading also the header line. How can i skip it in an easy way without using if
Answer : skip the header when reading a file
Oops, missed without if. Ok:
1: 2: 3: 4:
f = open(name) f.next() for line in f: print line.strip().split()
Open in New Window
Select All
Random Solutions
stripslashes in perl
Date functions - this week and this month
Acer OS boot Partition has gone loopy
Problems loading Acer drivers
Login script
NLS_LANG Turkish support problem
SQL Reporting Services - Runningvalue function in a graph
Windows 7 Freezes when screen saver is on
Exchange 2000 error -1526
Ajax response skipping (Validation fields)