Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
new in this area
#1
Hello I am pretty new in this type of data anlysis so I am learning and tsting myself.

I have received thsi text in .pre format with precipitaions.

Teh document looks like this:

Output:
Tyndall Centre grim file created on 22.01.2004 at 17:57 by Dr. Tim Mitchell .pre = precipitation (mm) CRU TS 2.1 [Long=-180.00, 180.00] [Lati= -90.00, 90.00] [Grid X,Y= 720, 360] [Boxes= 67420] [Years=1991-2000] [Multi= 0.1000] [Missing=-999] Grid-ref= 1, 148 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 3020 2820 3040 2880 1740 1360 980 990 1410 1770 2580 2630 Grid-ref= 1, 311 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 490 290 280 230 200 250 440 530 460 420 530 450 Grid-ref= 1, 312 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410 460 280 260 220 190 240 430 520 450 400 520 410
I have to extract teh data and export it into a table with this format:

Output:
Xref Yref Date Value 1 148 1/1/1991 3020 1 148 2/1/1991 2820
coming form the data previously attached. So each number within a row is corresponding to one month of a year and his value and each row is the data for each monthly value for a year.

I am pretty new so I would really appreciate if you can point me in some direction to get the result. I have read the document and tried to extract from each block from "grid-ref=" to the next "grid-ref=" to ride off of the beggining of the text. Unsuccessfully,

Thanks in advance
Reply


Messages In This Thread
new in this area - by Ana_junior - Dec-31-2020, 11:28 AM
RE: new in this area - by Larz60+ - Dec-31-2020, 04:14 PM
RE: new in this area - by Ana_junior - Jan-05-2021, 08:58 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020