eGospodarka.pl
eGospodarka.pl poleca

eGospodarka.plGrupypl.comp.programmingPowershell plik tekstowyRe: Powershell plik tekstowy
  • Data: 2011-05-04 20:43:12
    Temat: Re: Powershell plik tekstowy
    Od: p...@p...onet.pl szukaj wiadomości tego autora
    [ pokaż wszystkie nagłówki ]

    > Witam

    >

    > W pliku tekstowym mam coś takiego :

    >

    > Accuracy:

    > CurrentReading: 19

    > CurrentState: Normal

    > Description: Temperature Sensor 3 detects for Memory board. Temperature

    > reported by the sensor is within normal operating range.

    > DeviceID: Temperature Sensor 3

    >

    > Accuracy:

    > CurrentReading: 40

    > CurrentState: Normal

    > Description: Temperature Sensor 7 detects for Memory board. Temperature

    > reported by the sensor is within normal operating range.

    > DeviceID: Temperature Sensor 7

    >

    > Accuracy:

    > CurrentReading: 18

    > CurrentState: Normal

    > Description: Temperature Sensor 17 detects for Ambient / External / Room.

    > Temperature reported by the sensor is within normal operating range.

    > DeviceID: Temperature Sensor 17

    >

    nie wiem jak w powershellu ale w jakims troche poprawionym c to by bylo jak


    main()
    {
    int max_value = 0;

    for(;;)
    {
    int end_of_file, char* line = get_line("inputfile.txt");

    if(end_of_file) break;

    if(check_for_substring(line, ""CurrentReading:"))
    {
    remove_substring(line, ""CurrentReading:");
    remove_white_spaces(line);
    int value = string_to_int(line);
    if(value>max_value) max_value = value;
    }
    }

    if(max_value>45) send_email("w...@s...com", "alarm");
    }




    --
    Wysłano z serwisu OnetNiusy: http://niusy.onet.pl

Podziel się

Poleć ten post znajomemu poleć

Wydrukuj ten post drukuj


Następne wpisy z tego wątku

Najnowsze wątki z tej grupy


Najnowsze wątki

Szukaj w grupach

Eksperci egospodarka.pl

1 1 1

Wpisz nazwę miasta, dla którego chcesz znaleźć jednostkę ZUS.

Wzory dokumentów

Bezpłatne wzory dokumentów i formularzy.
Wyszukaj i pobierz za darmo: