Forum Moderators: open

Message Too Old, No Replies

Using regular expressions in Dreamweaver

search text and replace it with a tab

         

12inch

8:22 am on Apr 1, 2004 (gmt 0)

10+ Year Member



I'm using Regular Expressions in Dreamweaver and it is a real timesaver.

Now I want to search for a certain text and replace this text with a tab. So in the replace field I filled in "\t", but this doesn't work. I see "\t" being put in the text.

Does anyone know how to search for text (doesn't matter what) and replace this text with a tab?

Anand

piskie

8:43 am on Apr 1, 2004 (gmt 0)

10+ Year Member



Maybe you could replace with the ascii value of tab.

Just a thought

12inch

8:49 am on Apr 1, 2004 (gmt 0)

10+ Year Member



The ASCII value of tab is ALT + 09. But it doesn't show a tab in the replace field. It does in Notepad for example.

limbo

9:48 am on Apr 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know this sounds like a dumb question, but a tab in the source code wont show as a tab in a browser though will it?

12inch

9:50 am on Apr 1, 2004 (gmt 0)

10+ Year Member



Yes, you're right.

What I am actually doing is opening a textfile in Dreamweaver and search and replace spaces with tabs. When this is done, I can import this textfile as a tab-delimited file into a table.

stever

9:51 am on Apr 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There isn't such a thing as a tab in html - you would have to replace it with non-breaking spaces:  

Or, of course, do it with CSS and margins or padding.

Added: now I've seen your reply, wouldn't it be better to do it in a word-processing programme?

12inch

10:12 am on Apr 1, 2004 (gmt 0)

10+ Year Member



Thanx for the reply.

I have found an answer. Instead of replacing it with a tab, I replaced it with a colon or a semicolon. Then I can import it into Dreamweaver with

File > Import > Tabular Data >
data file: name.txt
delimiter: colon or semicolon

But I also checked if OpenOffice uses regular expressions, and it does. So that may also come in handy in the future.

whoisgregg

4:42 pm on Apr 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You've already found the answer for your problem, but here's an answer to the original question.

In code view, type a tab, select it, and copy it. Open the Find and Replace dialog and paste the tab into the replace field.

I'd prefer if there was a little pop-up with tab, return, etc. to insert like other apps tend to use, but Dreamweaver has no such functionality.

:)