How to I replace a series of time stamps from a document where each one follows a pattern but none are identical?

After a Skype session I often want to copy the text messages from the screen into a Pages document. The problem is when I do this using Cmd+C to Copy the text, pasting it using Cmd+V also brings over the Timestamp for each separate line. I want to remove these timestamps in one go. They all conform to a set pattern ie they begin with [ and end with ] but what is between these varies for each line. With sometimes 50 or more lines to do it is time consuming to manually remove these.


How can I set up a Find and Replace to match this pattern, but with a wildcard character such as * to represent everything between the square brackets? Does Pags use wildcards, and if so, which one do I need? I have to do this task every week and it's really tedious manually.


TIA

iWork Numbers-OTHER, Mac OS X (10.6.8)

Posted on Sep 3, 2013 3:29 AM

Reply
10 replies

Sep 3, 2013 6:52 AM in response to Jerrold Green1

Can you please explain how? The Skype window is a single column of text lines with the timestamp added in at the beginning of each line when you copy the text; they aren't visible when you look at the page.


I opened a Pages table and copied the stuff in using Cmd+A, Cmd+C, select table cell, Cmd+V and all the text was entered into a single column with each line's carriage return denoting the break point for each cell so that I still ended up with a single column of text with timestamp and text in the same cell. I opened Numbers and the same thing happened.


I realise what you are suggesting is non-intuitive and I must be missing something obvious, but I need more help please! 😕

Sep 3, 2013 2:57 PM in response to Jerrold Green1

Thanks! Here are two lines...


[03/09/13 21:23:53] AV: Se non fai i compiti, non puoi uscire con le amiche (correct)

[03/09/13 21:26:50] AV: Ieri notte ho investito con la macchina un riccio, non ..... evitarlo


Everything between "[" and "] AV: " inclusive is superfluous. All the numbers change with time and no two are the same, but those beginning and end sections are always identical; it is what is in between that changes each line.

Sep 3, 2013 4:14 PM in response to Basilisk

Basilisk,


User uploaded file

Your imported text is in column A and the expression that strips the preface is in column B. When I created a 2-column table in Pages and Pasted to the second column in A, it distributed itself over the rows with no problem. If you continue to have this problem, make sure you only single-click the cell before pasting. You don't want to be at the text layer for that paste.


The expression in column B is:


=RIGHT(Original, LEN(Original)-24)


After Filling column B with that expression, you should have what you want, but the column b display is dependent on column A and will not stand alone. Copy Column B and Paste it into a blank TextEdit document.


Copy the table in TextEdit, and Paste back into your Pages document. The new table (now a single column) will stand alone in Pages and you can delete the original table.


Jerry

Sep 4, 2013 6:23 AM in response to Jerrold Green1

Thanks for putting that together for me. I really appreciate your help! :-)


After I realised that when you wrote "Original" I should instead use the cell reference A1 where I had copied the text into it trimmed the text string by the fixed amount you had counted out. The problem is, the lengths of the info to be trimmed are variable. I can get around this by adjusting the trim length to exactly the timestamp length, then do a global Find and Replace for the variable bits (the names of each person in the messaging text conversation) which means a multi-step process which is sub-optimal. Pages really needs to be seriously updated!


Second problem is I need the final result as text, not as a table. Is there an easy way to convert the table to normal text?

Sep 4, 2013 7:12 AM in response to Basilisk

OK, instead of copying the Numbers Column B into Text Edit I used the more powerful but still free Text Wrangler instead and the table formatting was lost as I wanted. It's now just text in Pages.


A bit of a long winded way of going about things, especially when just having a single wildcard character would save all the workarounds, but at least I get where I want to now. Whether it's any quicker than a manual delete I don't know...maybe, maybe not. At least it's not so boring!


Thanks Jerrold :-)

Sep 4, 2013 12:30 PM in response to Basilisk

It's always good to give examples that cover the gamut of possibilities. Your examples both seemed to be padded to 24 total characters, so I assumed that the simple approach would be adequate.


It is certainly possbile to trap everything between the square brackets, plus the " AV:" string. Just a bit larger expression. Maybe I should have given the more general solution, but I also appreciate brevity when possible.


You can convert a Table to Text by Format > Table > Convert Table to Text.


Jerry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to I replace a series of time stamps from a document where each one follows a pattern but none are identical?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.