Pixel extraction-can not import .csv file

Hi there i want to use pixel extractor tool for a .NC4 file i got.it has nearly a million(maybe more)pixels and i just want to extract data of 30000 of it. since i need to state coordinates at parameters sections of the tool to extract those 30k data, i decided to use ‘add measurements from CSV file’ instead of manually writing down the 30k coordinates. but the problem is when i try to add my .csv file it shows the error in the picture.

i created the csv from Qgis and it can be perfectly imported and visualized in Qgis. Can you tell where i am doing wrong?

thanks in advance

Can you share the first ~3 lines of your CSV?
In addition, the expected format of the CSV is described on the help page Pixel Exctraction beneath the section The Parameters Pane.

sorry for the late response;

here is the csv qgis gave me…data:
30k deprem noktası-4.csv (2.1 MB)

screenshot of data:

also i seperate data by commas using as tabs here is the version…data:
30k deprem noktası-4 comma sepertor.csv (2.1 MB)

screenshot of data:

You should change to tab as separator and use Lon, Lat, DateTime and Name for the header. And use ISO8601 for the date time. Like

Lon Lat DateTime Name
-70.938 -12.861 2012-12-30T20:49:27 46 km E of Salvaci?n, Peru

Afterwards it should work.

Thank you for quick response,

but when i try to use tab as separtor both in excel and emeditor but they both didnt really separate data and it look exactly like the first image i send…therefore doesnt work

1 Like

Use a text editor (not a"word processor") to replace commas with tabs. You may have to first edit to remove commas from the Name column (e.g., first change commas to a character that doesn’t appear in the file (maybe ! @ # $ % & or *), change remaining commas to tabs, then restore the Name column. First experiment with a small file before spending a lot of time fixing a big file.

There are also issues in the lat column. Some contain text


These need to be deleted or corrected.

To convert the DateTime column you can follow these steps:

  1. Insert a new column: Add a new column next to the DateTime column to store the converted values.
  2. Enter the formula: In the first cell of the new column (e.g., D2), enter the following formula:

=TEXT(C2,"yyyy-mm-dd\Thh:mm:ss")

  1. Copy the formula down: Drag the formula down to apply it to the entire range
  2. Replace original values: If you want to replace the original column with the converted values:
  • Copy the new column
  • Paste as values over the original column using “Paste Special > Values”.

Then exporting it as Text (Tab delimited)
image

Now remove the quotes from the Name column by search and replace. The question marks must also be replaced, e.g., by a ‘_’.

Then it works:

Attaching an example of the first ~100.
coordinates.txt (6.9 KB)

Thank you,Marco! it worked wonders…but unfortunately SNAP doesnt process Date time:

My data-
30k deprem noktası-48.txt (1.9 MB)

Results:

The date-time column needs to be named ‘DateTime’ and the content of the column cells must follow the format yyyy-mm-ddThh:mm:ss, like 2012-12-30T20:49:27.
In your file the column is named ‘time’ and the values are like 12-24-12 (mm-dd-yy).

Thank you for help…

İ think i manage to do what you said but still have same problem…i tried all of these below:

30k deprem noktası-51.txt (2.3 MB)
30k deprem noktası-51.txt (2.3 MB)
30k deprem noktası-53.txt (2.3 MB)
30k deprem noktası-54.txt (2.3 MB)

but none of them worked