Skip to main content
Question

Reading specific rows in excel/csv

  • January 29, 2019
  • 4 replies
  • 164 views

Forum|alt.badge.img

Hi All,

Hope you are doing good.

I have an excel sheet containing a set of data wherein i wish to read only a specific set of rows. Test Excel.xlsx

In my case, i wish to read the data below the string (in mass percent) in row 280 from 281 to 296 with 281 as the column names. The whole table is supposed to be read below the above mentioned string. These row numbers may change with different excel sheets. So i need a generalized solution.

Please help. Thanks.

4 replies

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • January 30, 2019

Hi @asabhinavgreats Will the field names always be Carbon, Para, Iso, and Fin? You could read the Excel file, use a Tester to find where column A = (in mass percent), then use an AttributeManager to assign values of columns A-D to Carbon, Para, Iso, and Fin. Continue testing until 'Grand Total:' is found in column A.

 


fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • January 30, 2019

Here's a solution using VariableSetters and VariableRetrievers


fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • January 30, 2019
fmelizard wrote:

Hi @asabhinavgreats Will the field names always be Carbon, Para, Iso, and Fin? You could read the Excel file, use a Tester to find where column A = (in mass percent), then use an AttributeManager to assign values of columns A-D to Carbon, Para, Iso, and Fin. Continue testing until 'Grand Total:' is found in column A.

 

Here's a solution using VariableSetters and VariableRetrievers


Forum|alt.badge.img
fmelizard wrote:

Here's a solution using VariableSetters and VariableRetrievers

Thanks Dan for the answer. I tried using your method and it worked.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings