diff --git a/modules/util/viirs_l1b_l2.py b/modules/util/viirs_l1b_l2.py
index e865b3efc9a410389955b66bebed25a38ffc45ec..011378464441b8b8117423b2f1dc1b71f0d2014d 100644
--- a/modules/util/viirs_l1b_l2.py
+++ b/modules/util/viirs_l1b_l2.py
@@ -241,6 +241,7 @@ def scan(directory):
 def scan_for_location(txt_file, lon_range=[111.0, 130.0], lat_range=[14.0, 32.0]):
     with open(txt_file) as file:
         for idx, fpath in enumerate(file):
+            fpath = fpath.strip()
             h5f = h5py.File(fpath, 'r')
             try:
                 lon_s = get_grid_values_all(h5f, 'longitude')