Sign in to follow this  
Followers 0
marko001

Table managing help

5 posts in this topic

Hi all,

I have .csv I need to integrate in AutoIt to manage, modify and re-write

Mainly the array i got from the csv is dim $array1 [40000][7] (yes lots of rows).

What I need is managing it without Excel.

I'd like putting it in a Table? Listview? and updating datas then with an "update" button just re-export to the newly created .csv

Here is what could be the working area, I need obviously scrollbars (at least vertical)and opportunity to do fast filtering (to avoid all datas to be shown slowing execution).

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Birth Date", 667, 425, 192, 124)
$City_of_Birth = GUICtrlCreateCombo("City_of_Birth", 24, 32, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Country = GUICtrlCreateCombo("Country", 184, 32, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Over_65_y_o = GUICtrlCreateCombo("Over_65_y_o", 336, 32, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("Apply Filter", 568, 32, 75, 25)
$Only_males = GUICtrlCreateCheckbox("Only_males", 488, 34, 81, 17)
$ListView1 = GUICtrlCreateListView("", 8, 112, 634, 270, BitOR($GUI_SS_DEFAULT_LISTVIEW,$WS_HSCROLL,$WS_VSCROLL))
$Button2 = GUICtrlCreateButton("Export", 24, 384, 75, 25)
$Label1 = GUICtrlCreateLabel("First Name", 24, 88, 54, 17)
$Label2 = GUICtrlCreateLabel("Last Name", 96, 88, 55, 17)
$Label3 = GUICtrlCreateLabel("Birth Date", 160, 88, 51, 17)
$Label4 = GUICtrlCreateLabel("City of Birth", 232, 88, 57, 17)
$Label5 = GUICtrlCreateLabel("Country", 320, 88, 40, 17)
$Label6 = GUICtrlCreateLabel("Sex", 390, 88, 42, 17)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

I'd like to put the .csv (it's already formatted with "|" character") inside the list/grid and then modify it whenever needed.

Do you have some hint that could help me?

Thanks everyone,

M.

Share this post


Link to post
Share on other sites



Hi,

what data needs to manipulated? Who does it?

Putting all the lines into a listiview in Autoit is not that fast.

If you have advanced users, then you could just open the file in notepad and work the strg+f or something like that.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I have DB of customers. I know it's not so fast but I'd rather having everything embedded than using 3rd part applications as Excel.

I can put a Progressbar() until the process finishes.

What mainly I need is a) possibility to edit/modify datas from grid and then save everything to same (or different) file and :huh2: have some pre-made filters (as the gui shows) to apply to avoid loading all datas.

Thanks,

Marco

Share this post


Link to post
Share on other sites

This might give you an idea

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$db=@ScriptDir & "\custmer database.ini"
$Form1 = GUICreate("Birth Date", 667, 425, 192, 124)
$City_of_Birth = GUICtrlCreateCombo("City_of_Birth", 24, 32, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$data=IniReadSection($db,"Customers")
For $i=1 To $data[0][0]
    $split=StringSplit($data[$i][1],"|")
    GUICtrlSetData($City_of_Birth,$split[4])
Next
;~ GUICtrlSetData($City_of_Birth,
$Button1 = GUICtrlCreateButton("Apply Filter", 568, 32, 75, 25)
$Only_males = GUICtrlCreateCheckbox("Only_males", 488, 34, 81, 17)
$ListView1 = GUICtrlCreateListView("Export|First Name|Last Name|Birth Date|City of Birth|Country|Sex", 8, 112, 634, 270, BitOR($GUI_SS_DEFAULT_LISTVIEW,$WS_HSCROLL,$WS_VSCROLL))
$Button2 = GUICtrlCreateButton("Export", 24, 384, 75, 25)
#cs
$Label1 = GUICtrlCreateLabel("First Name", 24, 88, 54, 17)
$Label2 = GUICtrlCreateLabel("Last Name", 96, 88, 55, 17)
$Label3 = GUICtrlCreateLabel("Birth Date", 160, 88, 51, 17)
$Label4 = GUICtrlCreateLabel("City of Birth", 232, 88, 57, 17)
$Label5 = GUICtrlCreateLabel("Country", 320, 88, 40, 17)
$Label6 = GUICtrlCreateLabel("Sex", 390, 88, 42, 17)
#ce
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _Load(4,GUICtrlRead($City_of_Birth))
    EndSwitch
WEnd

Func _Load($filter_index,$filter_value)
    $data=IniReadSection($db,"Customers")
    For $i=1 To $data[0][0]
        $split=StringSplit($data[$i][1],"|")
        If $split[$filter_index]=$filter_value Then GUICtrlCreateListViewItem("|" & $data[$i][1],$ListView1)
    Next
EndFunc
.

Share this post


Link to post
Share on other sites

That's good and it works.

How is it possible to modify a cell and save the whole datas (or just the line who changed?)

i.e.

[...]

N. name last ph. mail

3 aaa bbb +1.222.333.4444 a@b.com

4 ddd ggg +1.333.222.1111 c@d.com

And I want to change mail of n.3 then save..

M.

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  
Followers 0