Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > carriage return/newline to space delineated file

carriage return/newline to space delineated file
Thread Tools
hadocon
Mac Elite
Join Date: Oct 2001
Location: Internet
Status: Offline
Reply With Quote
Apr 1, 2004, 07:07 PM
 
I also posted this in the UNIX group - Though I might be able to get a response here as well

I have a rather large text file of the form:

<BLOCKQUOTE>
abuse
abuts
abuzz
abyes
abysm
abyss
acari
acerb
acers
ached
aches
acids
acing
acini
ackee
acmes
acned
acold
.
.
.
</BLOCKQUOTE>

I want to trun this into a file that looks like this:

<BLOCKQUOTE>
abuse abuts abuzz abyes abysm abyss acari acerb acers ached aches acids acing acini ackee acmes acned acold...
</BLOCKQUOTE>

I know this can be done with a regular expression and BBEdit. Can anyone tell me how to do this?

Thanx in advance...
( Last edited by hadocon; Apr 1, 2004 at 09:18 PM. )
20+ year MacNN forum member. MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad Mini
     
megasad
Grizzled Veteran
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 1, 2004, 07:31 PM
 
Search for:

"\r"

And replace with:

" "

Without the quotes, obviously.
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
     
hadocon  (op)
Mac Elite
Join Date: Oct 2001
Location: Internet
Status: Offline
Reply With Quote
Apr 1, 2004, 09:06 PM
 
Originally posted by megasad:
Search for:

"\r"

And replace with:

" "

Without the quotes, obviously.
I have already tried this in BBEdit and it does not work. Technically I should be searching for /r/n for return and newline. Anyways, this does not work in BBEdit.

Anyone else have any ideas?
20+ year MacNN forum member. MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad Mini
     
hadocon  (op)
Mac Elite
Join Date: Oct 2001
Location: Internet
Status: Offline
Reply With Quote
Apr 1, 2004, 09:20 PM
 
This is from another thread in teh UNIX forum

Originally posted by Paul McCann:
In the find field enter

[^>]\r[^<]

and in the replace field just throw in a space. Select "use grep" and you should get
what you're after (assuming there's no leading spaces on the lines in the text file).

Cheers,
Paul
I tried this in BBEdit, but it did not work. I just get the system bell when I try to do this.

Here is the actual file I am working with.

As I said, I need this ASAP, so any help would be very appreciated!
20+ year MacNN forum member. MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad Mini
     
megasad
Grizzled Veteran
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 2, 2004, 08:54 PM
 
Originally posted by hadocon:
I have already tried this in BBEdit and it does not work. Technically I should be searching for /r/n for return and newline. Anyways, this does not work in BBEdit.
What version of BBEdit are you using? I just followed my own instructions on the file you linked to and it worked perfectly. Here you go.
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
     
hadocon  (op)
Mac Elite
Join Date: Oct 2001
Location: Internet
Status: Offline
Reply With Quote
Apr 2, 2004, 10:58 PM
 
Originally posted by megasad:
What version of BBEdit are you using? I just followed my own instructions on the file you linked to and it worked perfectly. Here you go.
Thanx 4 the help.
20+ year MacNN forum member. MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad Mini
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:14 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,