Re: FILTER RESULTS FOR OCCUPIED HOURS ONLY
Posted: Thu Jul 23, 2015 9:25 am
If you can use Python, then install a library called pandas.
The following script will do the job for you.
Just modify the csv file paths and you're good to go.
Example output can be found here.
I hope this helps.
The following script will do the job for you.
Code: Select all
import pandas as pd
# Setup values
ifilename = 'C:/path/to/the/input.csv'
ofilename = 'C:/path/to/the/output.csv'
# Read the csv file into a dataframe
dfI = pd.read_csv(ifilename, encoding='latin_1', header=None, mangle_dupe_cols=False, skipinitialspace=True)
# Extract headers into a transposed dataframe
dfH = dfI.ix[2:,0:3].T
# Extract values into a transposed dataframe
dfV = dfI.ix[:,4:].T
# Combine the dataframes into the final output dataframe
dfO = pd.concat([dfH,dfV])
# Write the dataframe to a csv file
dfO.to_csv(ofilename, encoding='latin_1', header=False, index=False)
Example output can be found here.
I hope this helps.