Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

OT: characters in paste from Excel

LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

I am trying to find out how Excel divides content between cells when you
copy a row/column of cells and paste it into a textarea.

Let's say I have two rows and each row has two cells of information, like
this -

Cell1.1 Cell2.1
Cell1.2 Cell2.2

and I copy and paste those 4 cells into a text area.

If I then want to separate the contents of Cell1.1 from Cell2.1 as separate
variables for further processing in PHP, how can I do that? I already know
that the two cells are not separated with a space.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



TOPICS
Server side applications

Views

513
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

On Tue, 27 Feb 2007 12:42:28 -0500, "Murray *ACE*"
<forums@HAHAgreat-web-sights.com> wrote:

>I already know
>that the two cells are not separated with a space.


As far as I know, they're separated by tabs.

Gary

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

That's what I thought, but when I do a str_replace('\x09','-',$content);, it
doesn't find it.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Gary White" <reply@newsgroup.please> wrote in message
news:11t8u25eap73a83djvtm4ltfqqkk7nhpk7@4ax.com...
> On Tue, 27 Feb 2007 12:42:28 -0500, "Murray *ACE*"
> <forums@HAHAgreat-web-sights.com> wrote:
>
>>I already know
>>that the two cells are not separated with a space.
>
>
> As far as I know, they're separated by tabs.
>
> Gary


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

On Tue, 27 Feb 2007 13:22:02 -0500, "Murray *ACE*"
<forums@HAHAgreat-web-sights.com> wrote:

>That's what I thought, but when I do a str_replace('\x09','-',$content);, it
>doesn't find it.


Where are you trying to do the replace? In PHP? Try:

preg_replace("/\t/","-",$content);

If in DW, in code view,
Find: \t
Replace with: -
Use Regular Expressions

If neither of those, where?

Gary

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

.oO(Murray *ACE*)

>That's what I thought, but when I do a str_replace('\x09','-',$content);, it
>doesn't find it.

The above searches for a literal '\x09' (4 chars!). You have to use
double quotes around the string, so PHP will replace these special
escape sequences, e.g. "\x09" or "\t".

You could also check with ord() what character it actually is.

Micha

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

That was certainly easy - right you are. Thanks, Micha!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Michael Fesser" <netizen@gmx.de> wrote in message
news:1a19u25ke4o2ekrrbcaosfpq2opgu2vgkb@4ax.com...
> .oO(Murray *ACE*)
>
>>That's what I thought, but when I do a str_replace('\x09','-',$content);,
>>it
>>doesn't find it.
>
> The above searches for a literal '\x09' (4 chars!). You have to use
> double quotes around the string, so PHP will replace these special
> escape sequences, e.g. "\x09" or "\t".
>
> You could also check with ord() what character it actually is.
>
> Micha


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

Gary:

It was a tab character, but my keyboard entered the wrong PHP code! 8(

Thanks!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Gary White" <reply@newsgroup.please> wrote in message
news:j209u2lrgd5kbsmt093lm7c1opd5t9oi5i@4ax.com...
> On Tue, 27 Feb 2007 13:22:02 -0500, "Murray *ACE*"
> <forums@HAHAgreat-web-sights.com> wrote:
>
>>That's what I thought, but when I do a str_replace('\x09','-',$content);,
>>it
>>doesn't find it.
>
>
> Where are you trying to do the replace? In PHP? Try:
>
> preg_replace("/\t/","-",$content);
>
> If in DW, in code view,
> Find: \t
> Replace with: -
> Use Regular Expressions
>
> If neither of those, where?
>
> Gary


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

.oO(Murray *ACE*)

>It was a tab character, but my keyboard entered the wrong PHP code! 8(

I have a guitar, which is quite the same. It (she?) never plays the
chords I want it to play. ;)

Micha

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

I know. It's deeply objectionable.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Michael Fesser" <netizen@gmx.de> wrote in message
news:ue79u2ti32t52vvo8cpnd9ngeho12h2qqp@4ax.com...
> .oO(Murray *ACE*)
>
>>It was a tab character, but my keyboard entered the wrong PHP code! 8(
>
> I have a guitar, which is quite the same. It (she?) never plays the
> chords I want it to play. ;)
>
> Micha


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2007 Feb 27, 2007

Copy link to clipboard

Copied

LATEST
On Tue, 27 Feb 2007 15:59:28 -0500, "Murray *ACE*"
<forums@HAHAgreat-web-sights.com> wrote:

>It was a tab character, but my keyboard entered the wrong PHP code! 8(

Silly keyboard. ;-)


>Thanks!

You're welcome.

Gary

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines