MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Disable " symbol


On 04/08/10 10:51, ibmichuco wrote:
> On Aug 3, 5:34 am, Albert Retey<a... at gmx-topmail.de>  wrote:
>> Am 02.08.2010 13:03, schrieb michuco:
>>
>>> Hi,
>>
>>> I am reading files of mixed strings and numbers using
>>
>>> Data1= Import["file","Table"]
>>
>>> where I have something like
>>
>>> A"   A"   A'
>>
>>> which should yield "{A",A",A'}", instead, mathematica
>>> gives me "{A"   A",A'}". Is there anyway that I can
>>> disable the double quote " sign so that mathematica
>>> doesn't take this as a string?
>>
>> I think the "TextDelimiters" option is what you are looking for.
>> Note that the list structure is still not what you expected:
>>
>> ImportString["A\"   A\" A'", "Table", "TextDelimiters" ->  {}]
>>
>> hth,
>>
>> albert
>
> Hi,
>
> That's it. Thanks
>
> Michuco
>
A more general solution is to read the file with something like:

ReadList["c:\\mydir\\myfile.dat", String]

This gives you a list of strings - one for each line of the file - and 
you can process them as you like.

David Bailey

http://www.dbaileyconsultancy.co.uk



  • Prev by Date: ListPlot with PlotStyle->Dashed causes problems
  • Next by Date: Re: Format
  • Previous by thread: Re: Disable " symbol
  • Next by thread: Re: different results for Standard vs Prefix forms