mseidel Posted March 18, 2019 Share Posted March 18, 2019 Hallo, I have got about 300 *.txt with passwords, IP Adresses, ... that I want to import into the keepass programm via csv import. The First step I think is to extract it into an ini file. each password.txt is inside a specific folder name the password.txt contains: user: specific1 password: specific_start_then_random user: specific2 password: random The idea is to go in each folder, open the txt file and for user specific1: search for "password: specific_start" and then copy the next signs until there is LF or CLRF into an ini file for user specific2: search for "password: " and then copy the next signs until there is LF or CLRF into an ini file can you give me a short plan with wich commands I should work? Thanks! Martin Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 18, 2019 Share Posted March 18, 2019 Hi @mseidel, and welcome to the AutoIt forums You could try _FileListToArray() to get the list of all .txt files you have, then loop through the array returned, use FileRead() to read the content of the i-file, and extract all the Users and Passwords stored in it, which then you can do whatever you want. Could you please provide a real-world (reproducible) example of a Password.txt file? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 18, 2019 Moderators Share Posted March 18, 2019 mseidel, 300+ files with IP addresses, user names and passwords? Please explain just what these are and what you intend doing with them. M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mseidel Posted March 29, 2019 Author Share Posted March 29, 2019 (edited) Hi, Sorry for my late answer, I havn't got an email. I'm working in an IT company an the Passwords are generated from the work at customers. An example of the txt file: Quote IP-Adresse: 192.168.2.31 Serial: 8027600364000017831 User: root Password: xYk7zWQjpYpU User: wbadmin Password: CFK394682 Contract-ID: Ev23K-sdCp7?tZ*T to "extract" the Password I think something like (?<=root\nPassword:\s)*(?=\s) should work or do you have a better idea? greetings Edited March 29, 2019 by mseidel Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 29, 2019 Moderators Share Posted March 29, 2019 mseidel, You work in IT and store customer usernames and passwords in clear text? Please tell me you are joking! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mseidel Posted March 29, 2019 Author Share Posted March 29, 2019 no, sad but true, my colleagues save them in clear text 🙈 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 29, 2019 Moderators Share Posted March 29, 2019 mseidel, Disgraceful! Well, we are certainly not going to encourage such appalling behaviour - thread closed. And can we please have the name of your company to make sure we have nothing to do with it in the future. M23 jchd and TheXman 2 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts