From: Keith (Southend)G on
On Jan 14, 7:30 pm, "Captain Jack" <CaptainJack1...(a)comcast.net>
wrote:
> "Keith (Southend)G" <keith_harr...(a)hotmail.com> wrote in message
>
> news:1abadf64-df4d-4b6e-b364-94619253cb1a(a)j24g2000yqa.googlegroups.com...
>
>
>
> > Thanks Jack,
>
> > This is how it currently looks from top to tail...
>
> Ah, I see... I was getting confused because of the way the text gets wrapped
> in the messages here. The problem is there are nine lines at the end that
> don't belong there, like a fragment of code that didn't get deleted.
>
> I commented out those lines at the end, and the program ran just fine; that
> is, clicking on Button2 created the file sorted.txt from the file
> ogimet.txt, without any errors.
>
> Just so I don't mess it up, I saved the code out to a text file, and put it
> up where you can download it, if you want. The extra lines are still in the
> file, I just marked them out as comments so they don't issue an error. I
> also deleted a few blank lines, but that didn't make any difference, I just
> did that in passing out of habit. You can get this latest version of the
> code here:
>
> http://www.CaptainJack3d.com/Code/ogprog.txt
>
> Let me know if you have any trouble with that.
>
> --
> Jack

Hello Jack,

Success :-)

The only thing I had to change was take out the '\tmp' from "C:\Tmp\"
to get it work. I've noticed some other little errors, but I need to
have a closer look to see whats causing it, maybe an error in the
original code.

Big 50 this weekend !

Many thanks

Keith (Southend)

From: Captain Jack on
"Keith (Southend)G" <keith_harris9(a)hotmail.com> wrote in message
news:a89da7c7-9945-4142-a698-5dda43555bbe(a)k19g2000yqc.googlegroups.com...
>
> Hello Jack,
>
> Success :-)
>
> The only thing I had to change was take out the '\tmp' from "C:\Tmp\"
> to get it work. I've noticed some other little errors, but I need to
> have a closer look to see whats causing it, maybe an error in the
> original code.
>
> Big 50 this weekend !
>
> Many thanks

Excellent. :-D

I forgot about the Tmp... I put my test files in a sub-folder. Glad you
found it.

Congrats, and have a good 'un.

--
Jack


From: Keith (Southend)G on
On Jan 14, 10:08 pm, "Captain Jack" <CaptainJack1...(a)comcast.net>
wrote:

> Excellent. :-D
>
> I forgot about the Tmp... I put my test files in a sub-folder. Glad you
> found it.
>
> Congrats, and have a good 'un.
>
> --
> Jack

Hi Jack,

I've had a good check though and there are no errors, everything has
'sorted' correctly :-)
I'm getting quite upbeat about this now, I can see the light at the
end of the tunnel, not to mention an extra 1/2 hour lay in every
morning ;-)

Now, for me to be able to use this 'additional' synop code, with what
I have, I need to then sort into individual date/time files. I guess
this step would read the 'new' 'sorted.txt' file and look at the first
group of numbers to 'trim'.

eg. taking a small sample from our 'sorted.txt' file, a separate file
for 14154, 14164, 14174, 14184 etc, would need to be created, although
ignore the 5th digit '4' in this example, as this number varies (/,
0,1, 3, 4.), again saved in" C\:"

"sorted.txt"
14184 03693 16349 /1102 10031 20031 30081 40083 53028 60042 91750 333
10035 87/06 88/22=
14174 03693 46350 /1204 10031 20031 30068 40071 53021 91650 333 87/08
86/21=
14164 03693 46350 /1105 10033 20033 30058 40061 52017 91550 333 82/08
88/21=
14154 03693 46356 /1304 10034 20034 30053 40055 53014 91450 333 85/08
87/24=
14184 03707 17/02 /1207 10017 20017 30088 40095 51029 60002 733//
91750 333 10027=
14174 03707 47/03 /1006 10018 20018 30080 40087 52032 734// 91650=
14164 03707 47013 /1105 10019 20019 30069 40076 53024 720// 91550 333
88/01=
14154 03707 47105 /1306 10023 20023 30058 40066 53016 732// 91450 333
88/02=

So the result would look something like this:
File name: "C\:1418.txt"
14184 03693 16349 /1102 10031 20031 30081 40083 53028 60042 91750 333
10035 87/06 88/22=
14184 03707 17/02 /1207 10017 20017 30088 40095 51029 60002 733//
91750 333 10027=

"C\:1417.txt"
14174 03693 46350 /1204 10031 20031 30068 40071 53021 91650 333 87/08
86/21=
14174 03707 47/03 /1006 10018 20018 30080 40087 52032 734// 91650=

"C\:1416.txt"
14164 03693 46350 /1105 10033 20033 30058 40061 52017 91550 333 82/08
88/21=
14164 03707 47013 /1105 10019 20019 30069 40076 53024 720// 91550 333
88/01=

"C\:1415.txt"
14154 03693 46356 /1304 10034 20034 30053 40055 53014 91450 333 85/08
87/24=
14154 03707 47105 /1306 10023 20023 30058 40066 53016 732// 91450 333
88/02=


I think I'm beginning to understand how this all hangs together now,
the important thing is to take one step at a time, you have to have
quite a clear and methodical mind. Therefore, if I'm correct what I'm
saying, the second procedure would be new code that would follow on
from we already have? So I would need to start with something like:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ProcessInput()
End Sub

' following

Return NewLine
End Function

Private Const InputFolder As String = "C:\"
Private Const InputFile As String = InputFolder & "sorted.txt"
Private Const OutputFolder As String = "C:\"
' This is the point where the individual files are created...
Private Const OutputFile As String = OutputFolder & "******"

I imagine all this can still come within "Sub Button2_Click" ?

I hope I'm not being a bit cheeky here ;-)

Many thanks

Keith (Southend)
From: Captain Jack on
"Keith (Southend)G" <keith_harris9(a)hotmail.com> wrote in message
news:d9de181c-392e-426c-b428-4c98a8cb2ecb(a)r5g2000yqb.googlegroups.com...

> Now, for me to be able to use this 'additional' synop code, with what
> I have, I need to then sort into individual date/time files. I guess
> this step would read the 'new' 'sorted.txt' file and look at the first
> group of numbers to 'trim'.

Actually, we can combine it in a single step; there's no need to dump it
into one file then split it into others. I made a change to the program to
do that... it's not the most efficient way, but it involved the least
changes to what we've already written. What I did was:

1. Changed the file name so that it's the first four characters of the
processed string, plus ".txt".
2. Change the place where we open the StreamWriter from the top of the Sub
to inside the loop.
3. Changed the flag on the StreamWriter to append to the file, not
overwrite.
4. Moved the StreamWriter's Close call up into the loop also.

That's going to give you a separate file name for each different time in the
input file. If you need date to be part of the file name also, we'd have to
make some more changes, because the function that processes the input line
calculates the date, but it doesn't return it right now.

The code is here:

http://www.CaptainJack3d.com/Code/ogprog2.txt

> I think I'm beginning to understand how this all hangs together now,
> the important thing is to take one step at a time, you have to have
> quite a clear and methodical mind.

That's about the most accurate description of a "programmer" I've ever
heard. :-D

> I hope I'm not being a bit cheeky here ;-)

Nope, I'm enjoying this. :-)

--
Jack


From: Keith (Southend)G on
On Jan 15, 3:09 pm, "Captain Jack" <CaptainJack1...(a)comcast.net>
wrote:

> > I think I'm beginning to understand how this all hangs together now,
> > the important thing is to take one step at a time, you have to have
> > quite a clear and methodical mind.
>
> That's about the most accurate description of a "programmer" I've ever
> heard. :-D

You flatter me :-)

> > I hope I'm not being a bit cheeky here ;-)
>
> Nope, I'm enjoying this. :-)
>
> --
> Jack

Wow, I wasn't expected such a quick reply :-)

Oh, I don't feel quite so bad now, I was worrying "You were giving an
inch and I was taking a yard". You don't know how much time all this
will save me, I can grow old more slowly. There is also the data
collection from the 'ogimet' website I haven't mentioned yet, where I
have created a form, but not got any further, now that one really will
be a challenge :-0
Weather has been a hobby since I was 15 and the internet has opened up
so many things.

OK, that once again worked straight away, but as usual my spec. was
flawed ;-)

Nothing major, one minor thing and two nicety's.

1. In the new files, now that we have them all separated I don't need
the 1st date/time numbers.
before:
14154 88963 42260 80518 11010 21023 39986 40002 57039=
14154 88968 41458 81410 10022 21011 39984 49999 58004 71022=
After:
88963 42260 80518 11010 21023 39986 40002 57039=
88968 41458 81410 10022 21011 39984 49999 58004 71022=

2., More of a nicety than a necessity but is it possible to then have
the final data in numerical order, so the 1st one would be
'01001' (happens to be Jan Mayen(9m)-Norway) and the last probably
'98851'(Gen.Santos(15m, Philippines)

3. Again a nicety, some locations report 'nil', so basically there's
no data, eg.
14151 14447 NIL=
In these instances nothing needs to be outputted, they can be ignored.


Many many thanks

Keith (Southend)