Pages

Showing posts with label Find and replace. Show all posts
Showing posts with label Find and replace. Show all posts

Friday, 12 January 2024

Find and replace hard returns

Every now and again we need to replace certain characters in Word using Find and Replace. Recently I wanted to sort a list of file names and APA references - which I had stashed in a Simplenote file - into alphanumeric order, in preparation for importing into my master articles spreadsheet. A number of my APA entries were different to the file name, for example:

Rotas-Palacio, C. M., & Abbas, R. (2023). Public Relations Committee with Cherry Rotas and Raza Abbas [Tuesday May 24] [video]. Asia Pacific Career Development Conference. https://asiapacificcda.vids.io/videos/709fdbb41f1ce2c3f9/645_public-relations-committee
APCDA - Rotas-Palacio & Abbas, Public Relations, 2023.mp4

I thought I would copy the list, and paste it into Word. But I knew if I sorted it in Word using paragraphs, I would end up with all my A's together at the top, and would have to scroll well down the page to find all the - in the case shown above - R entries.

If there weren't that many, it wouldn't be a problem. However, I had 200 entries that needed to go in my spreadsheet. I had left logging these articles WAY too long.

I knew that the Word code characters for a tab is "^t" (caret, t); and a hard return, or a paragraph, is "^p" (caret, p). I figured there must be code characters for a soft return. And there is: "^l" (caret, l; thank you McFadden, 2008).

All I needed to do was to use Word Find and Replace ^p for ^l on all my APCDA entries. I did that. The replace worked perfectly. My hard returns became soft returns, then I was able to sort all my data by Author name, the file names stayed with their APA entries (effectively in one paragraph), and I was able to import my sorted data. All 200 entries. 

Yay!


Sam

Reference:

McFadden, R. G. (2008, October 8). Is it possible to replace soft returns with hard returns?. https://www.pcreview.co.uk/threads/is-it-possible-to-replace-soft-returns-with-hard-returns.3641701/

read more "Find and replace hard returns"

Friday, 21 April 2023

How to find and replace in a blogger post

My blog was created on the venerable Google platform of Blogger. No problem with that, but the world has moved on in the past twenty years, and some things have always been a bit "you can't get there from here"... although ardent Blogger fans have often created code to help those less able users to do most things we need to do. But there is one small thing that I keep returning to: how to do a find and replace within a blog post.

You see, the blank spaces at the end of a paragraph in html code is often replaced with the " " character, or non-breaking space. This is usually a very handy trick that we use between elements which we don't want to line-break on, such as $5: we would enter this as "$ 5" to ensure that this all stayed together. However, when this non-breaking line space happens automatically at a paragraph end, the word wrapping often happens on the previous word, leaving line orphans in odd places.

Also, at the beginning of a post, if my first paragraph is too short, in my 30 word blog roll summary it looks like I have made a mistake and not left a trailing space after a full stop. So I at least want my first paragraph or two to have paragraph end trailing spaces.

So I tend to get rid of the auto-magically created " "s, or at least code them out as I go. I can do a "find" - easy peasy - simply Ctrl & F when in html blogger view, and I get a wee box at the top of the page that I can enter my find item into. However, "find and replace" function is not an easy find. Thanks to chiliNUT (2021) I can Ctrl, Shift & F, and I get a box for the replacement text (in the same place as the find box), then I need to hit enter to get the second box in the same place, where I can enter my replacement text. Note that if you are using this that there are not TWO boxes: one for find, and one for replace. This is a single box, activated by a keyboard 'Enter'.

There is an option to copy the html out into Notepad or Word, edit there, and return it, but this is a bit of a fag to do. I use the Shift & Ctrl & F option mostly, but in the past I used Notepad a lot (chiliNUT, 2021).

However, there is a third way to replace ALL the code or text in your Blogger blog. I have used this for broken links, and to harmonise phrasing or keywords in the past. Created by Adam Lewis, we go to his site here, and REALLY, REALLY think carefully through the consequences of doing a replace all, because we cannot easily undo it. I would recommend backing up the site content and design before doing this just in case there are unexpected outcomes!

I hope this helps someone :-D


Sam

References:

chiliNUT. (10 May 2021). How to find all and replace all on blogspot html editor?. StackOverflow. https://stackoverflow.com/questions/67465638/how-to-find-all-and-replace-all-on-blogspot-html-editor

Lewis, A. W. (2012). Blogger Find & Replace. https://www.adamwlewis.com/articles/blogger-find-replace?happy=1

read more "How to find and replace in a blogger post"

Monday, 13 March 2017

Argh! Why will my word table not let me drag text to the next cell?

Have you ever been working in a Word table, and suddenly found yourself unable to drag text?

You highlight text as normal, then go to drag it, but get a small "no symbol" (ie, a circle with a diagonal line through it as in the screen dump with this post) where your cursor should be.

I have struck this issue a couple of times in documents where I have imported text from elsewhere and am cleaning it up. I have found that if I saved the document, closed out, and then went back in, the problem would have self-corrected.

What I hadn't realised was that I had caused the problem in the first place.

How? Thanks to Kevin Stagner (9 April 2011) I now know that I had the "Find & Replace" dialogue box open. That seems to stop you being able to drag text.

As soon as you close that dialogue box, the problem stops. When I found that closing out of Word halted the problem, I was inadvertently closing the dialogue box on the way.

There is always learning!

Sam
read more "Argh! Why will my word table not let me drag text to the next cell?"

Friday, 20 May 2016

Intersection: YouTube transcripts and Find & Replace

For all my classes, I create video clips of my PowerPoint presentations, and upload them to YouTube. This means that students can double-check with the materials ...if they need to, or if they've missed something in class.

One thing that many people don't realise is that YouTube creates a transcript of everything that is uploaded. You can access the transcript by clicking the "more" and the three dots underneath (…) the video link, then selecting the transcript option from the pop-up menu.

The words of the transcript will show underneath that, which you can then copy (using Ctrl & C), and paste the transcript into MS Word.

However, the text that you paste into Word has a load of line breaks and transcription times. While this may be useful for analysis, it is not so useful if you just want to provide students with a script.

It can also take quite a long time if you have to go through in manually delete the times and the line breaks.

Recently, I posted an article on MS Word find and replace function. The find and replace function comes in useful here too, but you need to know the right codes to be able to get rid of the numbers and the breaks.

Using Word's find and replace function, the code to get rid of double-digit minute and second times, and line breaks is:
^p^#^#:^#^#^p

However, that will still leave you with all the single digit minute and second times, and line breaks. So you need to repeat the find and replace, using this code:
^p^#:^#^#^p

Then you should have just your words alone.


Sam
  • Reference: MS Office Support (n.d.). Find and replace text and other data in a Word document. Retrieved 25 February 2016 from https://support.office.com/en-us/article/Find-and-replace-text-and-other-data-in-a-Word-document-c6728c16-469e-43cd-afe4-7708c6c779b7#__toc282774575
read more "Intersection: YouTube transcripts and Find & Replace"