You need to sign in to do that
Don't have an account?
Swamy P
How to fetch a value from a particular row&column in an excel sheet by parsing Excel Sheet file
Hello Everyone,
I was working on Parsing Excel File by Apex but unfortunately i was not able to get specific row and specific column value. By using Parsing, i was able to fetch all of the columns but i wanted to get specific row also. Below is the code which I've used for Columns:
string csvAsString = csvFileBody.toString();
String[] csvFileLines = csvAsString.split('\n');
for(Integer i=1;i<csvFileLines.size();i++){
Contact accObj = new Contact() ;
string[] csvRecordData = csvFileLines[i].split(','); //In this i was able to fetch Columns, from this i wanted to get Row Value
}
Help me on getting the specific Row&Column value from an excel.
Thanks in advance!!!
I was working on Parsing Excel File by Apex but unfortunately i was not able to get specific row and specific column value. By using Parsing, i was able to fetch all of the columns but i wanted to get specific row also. Below is the code which I've used for Columns:
string csvAsString = csvFileBody.toString();
String[] csvFileLines = csvAsString.split('\n');
for(Integer i=1;i<csvFileLines.size();i++){
Contact accObj = new Contact() ;
string[] csvRecordData = csvFileLines[i].split(','); //In this i was able to fetch Columns, from this i wanted to get Row Value
}
Help me on getting the specific Row&Column value from an excel.
Thanks in advance!!!
I think you are almost there. If you are able to split the column data then use that array to populate column values in a loop. I assume you need always a fixed coumn value.
Below is the code that I tried, see if it helps.
Happy Coding.
Rajneesh