Hi,

I know I read about this somewhere, but I just can't find it again.

I am trying to write a script that will transfer data from a CSV file
to an Excel spreadsheet. The data has to do with the status of trouble
tickets. There can be any one of five different statuses for each
tech. There could be one or five or none. the data looks like this;

"Problem ID +","Assignee ","Status","D/T Reported +"
"PRB000007683094","joe.tech","New","3/30/2007 9:00:30 AM"
"PRB000007663668","joe.tech","Service Restored","3/23/2007 8:25:40 AM"
"PRB000007671182","dan.man","In Progress","3/26/2007 7:24:33 PM"
"PRB000007618787","dan.man","Service Restored","3/7/2007 10:50:10 AM"
"PRB000007671271","dan.man","Service Restored","3/26/2007 9:47:17 PM"
"PRB000007680738","dan.man","Service Restored","3/29/2007 11:50:54 AM"
"PRB000007652289","dan.man","Service Restored","3/19/2007 6:36:24 PM"
"PRB000007667099","dan.man","Service Restored","3/25/2007 3:48:01 AM"
"PRB000007489048","freebird","Pending","1/18/2007 12:30:31 PM"
"PRB000007621881","black.hat","Service Restored","3/8/2007 9:10:14 AM"
"PRB000007612876","jarhead","On Hold","3/5/2007 3:35:12 PM"
"PRB000007613512","jarhead","Service Restored","3/5/2007 6:00:28 PM"


If id do an If Then Else statement I only get one type, if I do a
Select case statement I get one type. How can I get each of them into
its proper place?

Re: Finding multipe cases that are true by mr_unreliable

mr_unreliable
Tue Apr 03 17:19:11 CDT 2007

hi OldDog,

What's the problem?

You posted your trouble log, but not your code.

To answer the question, either if/else or select case
would work, but your trouble seems to be separating
out the problem status.

You can get the problem status using the "split" function
on each of the lines in the log.

saLineParts = Split(sLogLine, ",") ' split at commas
sStatus = saLineParts(2) ' select third item (zero-based array)


cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

OldDog wrote:
> Hi,
>
> I know I read about this somewhere, but I just can't find it again.
>
> I am trying to write a script that will transfer data from a CSV file
> to an Excel spreadsheet. The data has to do with the status of trouble
> tickets. There can be any one of five different statuses for each
> tech. There could be one or five or none. the data looks like this;
>
> "Problem ID +","Assignee ","Status","D/T Reported +"
> "PRB000007683094","joe.tech","New","3/30/2007 9:00:30 AM"
> "PRB000007663668","joe.tech","Service Restored","3/23/2007 8:25:40 AM"
> "PRB000007671182","dan.man","In Progress","3/26/2007 7:24:33 PM"
> "PRB000007618787","dan.man","Service Restored","3/7/2007 10:50:10 AM"
> "PRB000007671271","dan.man","Service Restored","3/26/2007 9:47:17 PM"
> "PRB000007680738","dan.man","Service Restored","3/29/2007 11:50:54 AM"
> "PRB000007652289","dan.man","Service Restored","3/19/2007 6:36:24 PM"
> "PRB000007667099","dan.man","Service Restored","3/25/2007 3:48:01 AM"
> "PRB000007489048","freebird","Pending","1/18/2007 12:30:31 PM"
> "PRB000007621881","black.hat","Service Restored","3/8/2007 9:10:14 AM"
> "PRB000007612876","jarhead","On Hold","3/5/2007 3:35:12 PM"
> "PRB000007613512","jarhead","Service Restored","3/5/2007 6:00:28 PM"
>
>
> If id do an If Then Else statement I only get one type, if I do a
> Select case statement I get one type. How can I get each of them into
> its proper place?
>

Re: Finding multipe cases that are true by OldDog

OldDog
Wed Apr 04 18:08:28 CDT 2007

On Apr 3, 5:19 pm, mr_unreliable <kindlyReplyToNewsgr...@notmail.com>
wrote:
> hi OldDog,
>
> What's the problem?
>
> You posted your trouble log, but not your code.
>
> To answer the question, either if/else or select case
> would work, but your trouble seems to be separating
> out the problem status.
>
> You can get the problem status using the "split" function
> on each of the lines in the log.
>
> saLineParts = Split(sLogLine, ",") ' split at commas
> sStatus = saLineParts(2) ' select third item (zero-based array)
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but,
> no guarantee the answers will be applicable to the questions)
>
>
>
> OldDog wrote:
> > Hi,
>
> > I know I read about this somewhere, but I just can't find it again.
>
> > I am trying to write a script that will transfer data from a CSV file
> > to an Excel spreadsheet. The data has to do with the status of trouble
> > tickets. There can be any one of five different statuses for each
> > tech. There could be one or five or none. the data looks like this;
>
> > "Problem ID +","Assignee ","Status","D/T Reported +"
> > "PRB000007683094","joe.tech","New","3/30/2007 9:00:30 AM"
> > "PRB000007663668","joe.tech","Service Restored","3/23/2007 8:25:40 AM"
> > "PRB000007671182","dan.man","In Progress","3/26/2007 7:24:33 PM"
> > "PRB000007618787","dan.man","Service Restored","3/7/2007 10:50:10 AM"
> > "PRB000007671271","dan.man","Service Restored","3/26/2007 9:47:17 PM"
> > "PRB000007680738","dan.man","Service Restored","3/29/2007 11:50:54 AM"
> > "PRB000007652289","dan.man","Service Restored","3/19/2007 6:36:24 PM"
> > "PRB000007667099","dan.man","Service Restored","3/25/2007 3:48:01 AM"
> > "PRB000007489048","freebird","Pending","1/18/2007 12:30:31 PM"
> > "PRB000007621881","black.hat","Service Restored","3/8/2007 9:10:14 AM"
> > "PRB000007612876","jarhead","On Hold","3/5/2007 3:35:12 PM"
> > "PRB000007613512","jarhead","Service Restored","3/5/2007 6:00:28 PM"
>
> > If id do an If Then Else statement I only get one type, if I do a
> > Select case statement I get one type. How can I get each of them into
> > its proper place?- Hide quoted text -
>
> - Show quoted text -

Hi, thanks for the reply. The problem with the Select Case and If,
Then, Else methods is that it finds the first one that is true and
skips the rest. I think I will have to do multiple If,Then statments.
One for each of the possibilities.


Re: Finding multipe cases that are true by Michael

Michael
Thu Apr 05 00:40:11 CDT 2007

On 4 Apr 2007 16:08:28 -0700, "OldDog" <michael.r.felkins@...> wrote in
microsoft.public.scripting.vbscript:

>On Apr 3, 5:19 pm, mr_unreliable wrote:
>> hi OldDog,
>>
>> What's the problem?
>>
>> You posted your trouble log, but not your code.
>>
>> To answer the question, either if/else or select case
>> would work, but your trouble seems to be separating
>> out the problem status.
>>
>> You can get the problem status using the "split" function
>> on each of the lines in the log.
>>
>> saLineParts = Split(sLogLine, ",") ' split at commas
>> sStatus = saLineParts(2) ' select third item (zero-based array)
>>
>> cheers, jw
>>
>> OldDog wrote:
>> > Hi,
>>
>> > I know I read about this somewhere, but I just can't find it again.
>>
>> > I am trying to write a script that will transfer data from a CSV file
>> > to an Excel spreadsheet. The data has to do with the status of trouble
>> > tickets. There can be any one of five different statuses for each
>> > tech. There could be one or five or none. the data looks like this;
>>
>> > "Problem ID +","Assignee ","Status","D/T Reported +"
>> > "PRB000007683094","joe.tech","New","3/30/2007 9:00:30 AM"
>> > "PRB000007663668","joe.tech","Service Restored","3/23/2007 8:25:40 AM"
>> > "PRB000007671182","dan.man","In Progress","3/26/2007 7:24:33 PM"
>> > "PRB000007618787","dan.man","Service Restored","3/7/2007 10:50:10 AM"
>> > "PRB000007671271","dan.man","Service Restored","3/26/2007 9:47:17 PM"
>> > "PRB000007680738","dan.man","Service Restored","3/29/2007 11:50:54 AM"
>> > "PRB000007652289","dan.man","Service Restored","3/19/2007 6:36:24 PM"
>> > "PRB000007667099","dan.man","Service Restored","3/25/2007 3:48:01 AM"
>> > "PRB000007489048","freebird","Pending","1/18/2007 12:30:31 PM"
>> > "PRB000007621881","black.hat","Service Restored","3/8/2007 9:10:14 AM"
>> > "PRB000007612876","jarhead","On Hold","3/5/2007 3:35:12 PM"
>> > "PRB000007613512","jarhead","Service Restored","3/5/2007 6:00:28 PM"
>>
>> > If id do an If Then Else statement I only get one type, if I do a
>> > Select case statement I get one type. How can I get each of them into
>> > its proper place?- Hide quoted text -
>>
>> - Show quoted text -
>
>Hi, thanks for the reply. The problem with the Select Case and If,
>Then, Else methods is that it finds the first one that is true and
>skips the rest. I think I will have to do multiple If,Then statments.
>One for each of the possibilities.

This is in contradiction to your earlier statement:

There can be any one of five different statuses for each
tech. There could be one or five or none.

which is contradictory in itself. Also, the sample data provided only
shows one status for any record. Which is it?

To get meaningful help, it is always a good idea to post the code you
have so far.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"