0

I have excel files (hundreds of them) that look like this (sensor output):

Column1          Column2    Column3

Serial Number:
10004
Ref. Temp:
25C
Ref. Pressure:
1KPa
Time              Temp.     Pres.
1                 21        1
2                 22        1.1
3                 23        1.2
.                 .         .
.                 .         .
.                 .         .

I want to split this into two parts, the information section (top part) and data section (the rest), something like this:

Information section

Column1          Column2    Column3

Serial Number:
10004
Ref. Temp:
25C
Ref. Pressure:
1KPa

Data section:

Column1      Column2    Column3
Time          Temp.     Pres.
1              21       1
2              22       1.1
3              23       1.2
.              .            .
.              .            .
.              .            .

if it converts to data frame I don't want the first row and column become header and index of the data frame. I am using python 2.7 and numpy.

1 Answer 1

1
  • Make two copies of the worksheet.
  • In copy A, start a loop, going on the first column looking for the word Time. Once it finds it, let it delete anything before it.
  • Remember the row in a variable.
  • In copy B, delete anything after the remembered row to row number 2^20.
Sign up to request clarification or add additional context in comments.

2 Comments

I have hundreds of files with several sheets like this. I want to do it automatically. I wonder how I can do it on the fly without doing manually or creating additional files.
@Bob - there is nothing manual in the solution that I have offered - these are the automatization steps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.