Since a CSV file is a plain text file, you can edit it prior to importing in KeePass. The idea is to modify the CSV by typing in the target folder (called Group in KeePass) you want, then import it.
Keepass supports a
Group field, which represent folders. Keepass also supports specifying subgroups which will translate into subfolders, so if the LastPast CSV has a group/folder column already and you'd like to retain your LastPass categories as subfolders, you can prepend
LastPass\ in front of each group entries (or
LastPass\\ if you need to use the escape backslash option).
A good way to edit a CSV is to open it in Excel, use the "Text to columns" function to separate columns by comma, leaving all fields as "Text" type, modify the column that represents the group, then save it back as a CSV file.
I recommend making a backup copy of your CSV and your Keepass KBDX files before doing this, just in case.
Detailed procedure (Manual)
As you can see in the first line of your CSV, the
Grouping column is the penultimate one. I typed
From LastPass before the last comma in each line:
https://login.yahoo.com/config/login_verify2?.intl=ca&.src=ym,firstname.lastname@example.org,af!@Ra#w12,,Yahoo mail,From LastPass,0
Then imported into KeePass:
All entries were imported in the
From LastPass folder, which I believe was your question.
Detailed procedure (Excel)
If you don't want to do it by hand for each line, here's how to do it all at once in Excel:
- Open the CSV file in Excel by choosing "Text files" in the open dialog.
- You will likely see this. Select the entire column A, then in the Data menu click
Text to Columns to open up the wizard.
- Select only
Comma as the delimiter
- Select all columns in the bottom preview (scroll right and
shift+click on the last column header), and choose
Text as the data format. This is to tell Excel not to try to treat the information as numbers or dates, which could end up removing leading zeros and so on.
- The data should now be in a spreadsheet format like this. Note the grouping column.
- Type in the folder name you want, and copy paste it on all rows.
- File..Save As to open the save dialog. Make sure to choose
CSV as the type.
The import in the same way as the manual steps above. With your sample data, both the manual and the Excel method gave the same results using KeePass 2.34.