Page 2 of 2

Re: FILTER RESULTS FOR OCCUPIED HOURS ONLY

Posted: Thu Jul 23, 2015 9:25 am
by JohnM
If you can use Python, then install a library called pandas.

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)
Just modify the csv file paths and you're good to go.

Example output can be found here.

I hope this helps. :)

Re: FILTER RESULTS FOR OCCUPIED HOURS ONLY

Posted: Fri Jul 24, 2015 1:02 pm
by btysoe
Thanks I'll give it a go.