Jump to content
Sign in to follow this  
chacoya121

plz help how to organize from notepad or Ini file

Recommended Posts

plz help how to organize information from notepad or INIfile

Example:

0=000308
1=000308
2=000308
3=000308
4=000408
5=000408
6=000408
7=000408
8=000408
9=000408
10=000308
11=000308
12=000308
13=000408
14=000408
15=000408
16=000408
17=000408
18=000408
19=000408
20=000308
21=000308
22=000308
23=000408
24=000408
25=000408
26=000408
27=000408
28=000408
29=000408
30=000308

 0=000308 x 11 total

 1=000408 x 20 total

2 lines summary all

 

Thank you

 

Edited by chacoya121

Share this post


Link to post
Share on other sites

What do you mean by organize? Do you want to create an Ini File in sections like, or do you want to just read the data into an Array?

[000308]
01=000308
02=000308
...
[000408]
01=000408
02=000408
...

 

Share this post


Link to post
Share on other sites

read data and organize and count total of each result

0=000308
1=000308
2=000308
3=000308
4=000408
5=000408
6=000408
7=000408
8=000408
9=000408
10=000308
11=000308
12=000308
13=000408
14=000408
15=000408
16=000408
17=000408
18=000408
19=000408
20=000308
21=000308
22=000308
23=000408
24=000408
25=000408
26=000408
27=000408
28=000408
29=000408
30=000308

total = 11x 000308
total = 20x 000408

 

Edited by chacoya121

Share this post


Link to post
Share on other sites

You can try something like:

#include <Array.au3>
#include <File.au3>

Local $aArray, $a000308[1][2], $a000408[1][2]
_FileReadToArray("Dummy01.txt", $aArray, $FRTA_COUNT, "=")
For $i = 1 To $aArray[0][0]
    If $aArray[$i][1] = "000308" Then
        _ArrayAdd($a000308, $aArray[$i][0] & "|" & $aArray[$i][1])
    Else
        _ArrayAdd($a000408, $aArray[$i][0] & "|" & $aArray[$i][1])
    EndIf
Next
$a000308[0][0] = UBound($a000308) - 1
$a000408[0][0] = UBound($a000408) - 1
_ArrayDisplay($a000308)
_ArrayDisplay($a000408)
_ArrayDisplay($aArray)

 

Share this post


Link to post
Share on other sites

another way,

#include <Array.au3>

Local $sum[1][2], $find, $index, $count = 0, $source = IniReadSection("new.ini", "section")

Local $tmp = _Array_FromColumn($source, 1)

Local $ini = _ArrayUnique($tmp, Default, Default, 1, 0)

For $i = UBound($ini) - 1 To 1 Step -1
    $find = $ini[$i]
    $index = UBound($source) - 1
    Do
        $index = _ArraySearch($source, $find, 0, $index - 1, 1, 0, 0, 1)
        If Not @error Then
            $count += 1
        EndIf
    Until @error Or $index <= 1
    _ArrayAdd($sum, $find & "," & " x " & $count, 0, ",")
    $sum[0][0] += 1
    $count = 0
Next

_ArrayDisplay($sum)

Func _Array_FromColumn(ByRef $aArray, $iColumn = 0, $istart = 1)
    Local $aArray1D = ['']
    For $i = $istart To UBound($aArray) - 1
        _ArrayAdd($aArray1D, $aArray[$i][$iColumn])
    Next
    Return $aArray1D
EndFunc   ;==>_Array_FromColumn

 

Edited by Deye

Share this post


Link to post
Share on other sites
HotKeySet("{Home}", "Start")
HotKeySet("{Esc}", "MyExit")

Global $colorcount = 0

While 1
    Sleep(100)
WEnd

Func MyExit()
    Exit
EndFunc

Func Start()
    For $i = 0 to 9 Step +1
        For $j = 0 to 9 Step +1
            $color = PixelGetColor($i,$j)
            IniWrite("Color Code.ini","Color",$colorcount,Hex($color,6))
            $colorcount += 1
        Next
    Next
EndFunc

can someone help me organize this color count, i m just curious how it work, cuz i try to figure out how it work but soo confusing me, im low lvl programing and sorry for my english

Edited by chacoya121

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AZJIO
      My Notepad v0.4 (En, Ru)

      Black theme

       
      My_Notepad.7z (560kb sources + EXE)
       
      I wanted to make an example for the help file. But I could not stop, and made more complicated.
    • By nacerbaaziz
      hello sirs,
      i have searched allot about an function that can  read the INI file as a  string
      i mean function to read the ini files from string and not from the file directly.
      i finally found an UDF that do what i want
      but unfortunately all the functions work,  but the function that i want it not working.
      this is the udf
      the function that  i need is _IniReadFromString
      this is the function

      Func _IniReadFromString($szInput, $szSection, $szKey, $Default) $szInput = StringStripCR($szInput) Local $aRegMl = StringRegExp($szInput, "\[" & __StringEscapeRegExp($szSection) & "\]\n+(?:[^\[].*?=.*\n)*" & __StringEscapeRegExp($szKey) & "=(.*)\n?(", 3) If @error Then Return SetError(1, 0, $Default) ; key not found Return $aRegMl[0] EndFunc;==>_IniReadFromString
      i hope that any one can help me
      thank you in advance
      iniex.au3
    • By Ronster
      I would like to create an auto login program using mouseclicks, controlclicks only, or whatever is required to send characters from Windows 10 On-Screen Keyboard to a User/Password login form. I thought I would start with OSK to NotePad. Using mouseclicks to enter ID/Password seems more secure than typing plain text. Seems like if I can get that to work I should be able to send the characters to any login form. I have tried many things but cannot send a character(s) from OSK to Notepad. Of course manually works great. Here is some code I have tried:
      ControlGetFocus ("Untitled - Notepad")
          ; go to Notepad window
          MouseMove(649, 206 , 0)  ;move to Notepad, then click below
          Sleep (1000)
          MouseClick($MOUSE_CLICK_LEFT,"left")
          ControlGetFocus ("On-Screen Keyboard")
          ; go to OSK window then click on a character key
          MouseMove(642, 807 , 0) ;letter - t
          Sleep (1000)
          MouseClick($MOUSE_CLICK_LEFT,"left")
      OR
      ControlClick("On-Screen Keyboard","","[CLASS:OSKMainClass]","left","",642, 807)
      The above move to the correct position and appear to click but focus is lost to Notepad. Any help would be appreciated.
    • By SkysLastChance
      Run("notepad.exe") GLOBAL $One = ('Line1' & _ 'Line2' & _ 'Line3' & _ 'Line4' & _ 'Line5') ClipPut($One) $Notepad = WinWait("[CLASS:Notepad]", "", 10) ControlSend("Untitled - Notepad", "", "", ("^v")) Instead of having this paste as Line1Line2Line3Line4Line5
      How can I make it paste it into notepad as (without double spacing.)
      Line1
      Line2
      Line3
      Line4
      Line5
    • By Miliardsto
      Checkout this why "OR" not works thats my code
      Global $color[2] = [0xE74747,0xE94747] Func Refresh() $StartConst[0] = $Start[0] ; reset value While $StartConst[0] <> $End[0] Local $i $i += 10 $StartConst[0] += 17 $col = PixelGetColor($StartConst[0], $StartConst[1], $Title) ; get color ;For $t = 0 to 2 ; <- i know it could be done in for loop but it not works in my program If $col <> $color[0] Then ; <- why this not works Global $NowVal = $i ; GUICtrlSetData($m_actual, $NowVal) ; ExitLoop EndIf ;Next WEnd EndFunc I want to check 2 colors without for loop but this below not works . it checks only first value why?
      If $col <> $color[0] Or $col <> $color[1] Then ; <- why this not works  
×
×
  • Create New...