|
|
carriage return/newline to space delineated file
|
|
|
|
Mac Elite
Join Date: Oct 2001
Location: Internet
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Oct 2002
Status:
Offline
|
|
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)
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2001
Location: Internet
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2001
Location: Internet
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Oct 2002
Status:
Offline
|
|
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)
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2001
Location: Internet
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|