Click here to Skip to main content
15,899,634 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to sort out latitude and longitude from an excel file using c# or any other programming??? the condition is like this
if latitude is less than 0 degree discard
if latitude is more than 40 degrees discard
if longitude is less than 60 degrees discard
if longitude is more than 100 degrees discard
Posted

1 solution

Use one of these to open and read the Excel file:
Excel Interop: http://csharp.net-informations.com/excel/csharp-excel-tutorial.htm[^]
NPOI[^]
EPPlus[^]

Once you've read your latitude and longitude, your condition would look like this in C#:
C#
if (latitude >= 0 && latitude <= 40 && longitude >= 60 && longitude <= 100)
{
   // do something
}
// else don't
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900