How can I use KM to copy unstructured data. Advanced copy-paste

I have a website that I need to copy the data(text only) from but some of the information is missing and it’s very unstructured.

I need to copy it and paste into specific column in Excel.
What would be the best option?

I was thinking about creating a named clipboard for each piece and then pasting it by simulating the Tab and paste button.

Data1 -> Name Clipboard1
Data2 -> Name Clipboard2
Data3 -> Name Clipboard3

Paste into EXCEL columns 1,2,3 and reset the all the name clipboards.

In terms of copying the information from the website what aproach should I take? Macro pallete?

With a mouse highlight the text(“Data1”) press 1 to copy to Clipboard1?

Hi @mariuszS,

How is the data that you want to copy formatted on this website? If you can give us an example of text you want to copy (if the information is sensitive, it doesn't need to be the exact data, but it should be in the same format) and a more precise example of how you would like to paste that data into Excel, I'm sure we can help you out.

One suggestion I can make just from what you've told us so far is to use a Insert Text By Pasting macro that includes the last three things you've copied separated by tabs, which would let you essentially save any three pieces of data you want to paste into Excel just by copying them like usual in the order you want to paste them. This should be easier than named clipboards, and should make pasting this data into Excel a one-click (via macro palette) or single hotkey (if you assign it a keyboard shortcut) affair. Here's an example to show what I mean.
Paste Into Excel Columns.kmmacros (1.4 KB)


(it may not be readily apparent from the image, but each of those clipboard tokens is separated by tabs)

Hi @gglick.

Most of it is just plain text with mainly contact details. There are 10 columns to fill and some of the information(like email address)might be missing

I need a way to fill the information in the correct column.

So really what I need is some way of tracking the information in the clipboard.
Would a macro pallete help here? I’m still struggling with building one.

  1. Company’s name
  2. Name
  3. Surname
  4. Email
  5. Address
  6. Date
  7. Tag
  8. Comments
  9. Other info
  10. Other info
  11. Other info

Once on the website I highlight the information required like the company’s name, I press the relevant key like 2 for the “Name” and it’s being copied.

So as mentioned before with every piece of information not always being available is it possible to copy and paste the text without using the named clipboards?

Once I have the full information the macro should paste it into a row in Excel.

Hmm. If the main thing you need is a way to keep track of information in the clipboard, I don't think you need to use named clipboards or a macro palette; the simplest option should just be to take advantage of Keyboard Maestro's regular clipboard history. KM automatically saves the last 200 things you cut or copy even without using named clipboards, so you could take advantage of that to copy every piece of data in a given category, then invoke the clipboard history viewer and paste the copied data into Excel from there instead of constantly switching back and forth between the site and the spreadsheet. My suggestion for making this process go faster is:

  1. Download and install this sample macro (feel free to change the keyboard shortcut to something more to your preferences): Paste and Delete Contents of Current Clipboard.kmmacros (2.0 KB)

  2. Copy every piece of data in a given category in reverse order, from last to first.

  3. Begin at the beginning of the data category's row and invoke the macro while selecting the appropriate cell. The macro will paste the most recent piece of data you copied and then delete it so that the next piece of data will be pasted the next time you invoke it. Repeat until all the relevant data is pasted.

This was just an idea how the imformation looks like.
The issue here is that the it can get complex and long.

Ideally I’d like it work like this:

Highlight the text by somehow identyfying what is it being copied.
Some fields are missing and that’s ok as long as the corresponing cell in Excel remains empty.

Highlight Company’s Name ->Copy
Highlight Name ->Copy
Highlight Surname ->Copy
No info for the email address -> move to next one
Highlight Address ->Copy

Then the data is being pasted into Excel with appropriate cells filled in.

Hey Marius,

There’s really no way to help you without seeing some real sample data.

Parsing text is a complicated business, and there isn’t room for guessing.

Can you provide any example URLs?

-Chris

Hi,

This is a sample website.


Login required (Facebook, LinkedIn)
I need to grab information like contact details, description, links and other stuff as I go.
With being able to track what has already been copied.
I would go call it inteligent copy/paste :slight_smile:
Hope that helps.