redcedar Posted September 8, 2020 Share Posted September 8, 2020 I need to find/replace multiple carriage returns. I need to know if there are special character combinations I can use to represent a carriage return. Quote Link to comment Share on other sites More sharing options...
v_kyr Posted September 8, 2020 Share Posted September 8, 2020 Usually you can use the following simple expression ... [\r\n] = Win cariage return & linefeed (should match either or both then) [\r] = Win cariage return [\n] = Unix/Mac linefeed ... in a reg expr which should match those characters. Though Publisher might use/have a predefined paragraph end symbol which you can use then instead in a normal find/replace run. redcedar 1 Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
redcedar Posted September 8, 2020 Author Share Posted September 8, 2020 Thank you, v_kyr. I tried /n and it won't work. The FIND function does not recognize it as anything other than text characters. Have been trying to work an existing .pdf document that was written in Apple Pages. Loaded it into Publisher, but it comes up with line returns after every line in the doc. Was hoping to use FIND/REPLACE to deal with these. I don't know anyway to get Publisher to recognize this text as continuous. Microsoft used to use the carat ^ symbol to initiate commands, so that line return was ^p. Having a tough time here. Thanks for your time! Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted September 8, 2020 Share Posted September 8, 2020 9 minutes ago, v_kyr said: Though Publisher might use/have a predefined paragraph end symbol which you can use then instead in a normal find/replace run. In fact, Publisher does have such a character, and it's available in the pull-down for the Find string: redcedar 1 Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1 Link to comment Share on other sites More sharing options...
walt.farrell Posted September 8, 2020 Share Posted September 8, 2020 9 minutes ago, redcedar said: The FIND function does not recognize it as anything other than text characters. You need to tell it to do a Regular Expression search if you use the regular expression characters that v_kyr showed you: On the other hand, the Paragraph Break special character should work in either mode. redcedar 1 Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1 Link to comment Share on other sites More sharing options...
v_kyr Posted September 8, 2020 Share Posted September 8, 2020 14 minutes ago, redcedar said: Thank you, v_kyr. I tried /n and it won't work. The FIND function does not recognize it as anything other than text characters. Have been trying to work an existing .pdf document that was written in Apple Pages. Loaded it into Publisher, but it comes up with line returns after every line in the doc. Was hoping to use FIND/REPLACE to deal with these. I don't know anyway to get Publisher to recognize this text as continuous. Microsoft used to use the carat ^ symbol to initiate commands, so that line return was ^p. Having a tough time here. Thanks for your time! For Unix/Mac based text you search in a regular expression for "\n" and not "/n", since on Unix systems and Macs a \n is the linefeed character. On Windows in texts a line end is instead \r\n, so a carriage return + linefeed. - I would assume that Pages also used \n as linefeeds here when generating a PDF, since usually that's the common way for text handling of Unix (and MacOS is a BSD based Unix) systems. In reg expressions a "^" indicates a line start position, thus a reg expr like "^A" would search after a capital (uppercase) A at the start of a text line (the ^). You can play with and test your regular expressions here at https://regex101.com/ redcedar 1 Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
sfriedberg Posted September 8, 2020 Share Posted September 8, 2020 1 hour ago, redcedar said: I tried /n and it won't work You want backslash, not forward slash, when you try that. Ah, I see y_kry already mentioned that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.