[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: EL Coding: How to write a double-quote character, ", to a file <- a solution



PureBytes Links

Trading Reference Links

Now I don't know if this will work in earlier or later versions of Excel,
but it works in 2000.

The solution is simply to use a character that does not have any meaning for
Excel functions, something like "_", "~", "|", or "z".  This is a
no-problems job for Easy Language.  Save this file as a *.txt file, not
*.csv.  Then, when importing the file into Excel, check "Other" as a
delimiter option, and specify your character.  Like this:

File created with Easy Language:

1_2_3_=(A1+B1)^C1_"=A"
2_3_4_=(A2+B2)^C2_"=B"
3_4_5_=(A3+B3)^C3_"=C"
4_5_6_=(A4+B4)^C4_"=D"

IMPORTANT!  This file HAS to be saved as a *.txt, *.dat, or something else
(you can even make it up yourself, *.ivo for example ;-), but NOT as *.csv.
Excel will import *.csv files automatically as comma-delimited.  For other
files, you'll get the import wizard with more options.

Then import the file into Excel, specifying "_" as the delimiter.  This will
work equally well when importing the file using VBA or macros.  In Excel,
the sheet with imported file will look like this:

1	2	3	27	"=A"
2	3	4	625	"=B"
3	4	5	16807	"=C"
4	5	6	531441	"=D"

Hoping this solves the problem,

Ivo




-----Original Message-----
From: Bob Hunt [mailto:RHunt@xxxxxxxxxxxxxxx]
Sent: Friday, January 18, 2002 11:56 PM
To: Peter B. Nelson
Cc: code-list@xxxxxxxxxxxxx; Omega List
Subject: Re: EL Coding: How to write a double-quote character, ", to a file

Peter,

I'd love to hear a solution for this too. The best that I've come up with is
to use
a character not used often to stand in its place (such as the ` character),
and
then create a macro to do a find and replace.

Bob Hunt



"Peter B. Nelson" wrote:
>
> Fellow EL Coders,
>     Does anyone know how to get a double-quote character, ",  into a
string
> using EasyLanguage?  I need to write one into a file for Excel .CSV
parsing.
> I looked for, and didn't find, an escape character, a char(34) funtion,
and
> so on.
>     Any help is appreciated.
>
> Regards,
> Peter Nelson