Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Mathematica is destroying my sanity....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53095] Re: [mg53066] Mathematica is destroying my sanity....
  • From: DrBob <drbob at bigfoot.com>
  • Date: Thu, 23 Dec 2004 07:58:46 -0500 (EST)
  • References: <200412220953.EAA04475@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

Put (>>) and Get (<<) are the functions you need. Put will output any Mathematica expression, and Get retrieves it.

Bobby

On Wed, 22 Dec 2004 04:53:04 -0500 (EST), Todd Allen <genesplicer28 at yahoo.com> wrote:

> Hi everyone (and Happy Holidays!)
>
>      I am trying to parse a 450 Mb text file for
> certain important information and then would like to
> save the smaller, parsed information in a suitable
> file for later importation and futher analysis.  I
> have made some progress, but have stumbled yet again.
>
> Below is the situation:
>
> In[1]:=
> SetDirectory["D:\\"]
> In[2]:=
> blastn=OpenRead["Cpara-SelfBlast120804(2).txt"]
> In[3]:=
> subblastn=ReadList[blastn,Record,RecordSeparators\[Rule]{{"Value"},{">"}}];
> In[7]:=
> temp1=Table[StringSplit[subblastn[[i]]],{i,1,Length[subblastn]}];
> In[9]:=
> temp2=Table[Partition[temp1[[i]],3],{i,1,Length[temp1]}];
>
>
> ***The output for temp2 is a nicely organized set of
> sublists:
>
> Out[10]=
> {{CEST-01-A-01,1120,0.0},{CEST-17-A-06,985,0.0},{CEST-04-E-04,52,
>3e-07},{CEST-28-H-03,50,1e-06},{CEST-46-G-10,48,5e-06},{CEST-37-B-11,48,
>5e-06},{CEST-21-D-05,48,5e-06},{CEST-21-A-11,48,5e-06},{CEST-21-A-10,48,
>5e-06},{CEST-19-G-12,48,5e-06},{CEST-13-F-07,48,5e-06},{CEST-10-E-05,48,
>5e-06},{CEST-04-E-08,48,5e-06},{CEST-60-C-12,46,2e-05},{CEST-59-D-02,46,
>2e-05},{CEST-29-A-06,46,2e-05},{CEST-26-H-10,46,2e-05},{CEST-25-F-11,46,
>2e-05},{CEST-20-C-11,46,2e-05},{CEST-19-F-10,46,2e-05},{CEST-11-E-06,46,
>     2e-05}}
>
> ****At this point, I want to save the data and
> organized structure of the data currently contained in
> temp2.
>
> I have tried numerous variations, with the following
> being the best (yet still undesirable) result:
>
> Export["subparseBlastN", temp2, "List"] (* to save
> data *)
>
> In[45]:=
> tempsub=Import["subparseBlastN","Table"];
>
> ****The result of the new import in "tempsub" looks
> awful and really messes up the data organization for
> me:
>
> Out[47]=
> {{{"CEST-01-A-01",,"1120",,"0.0"},,{"CEST-17-A-06",,"985",,"0.0"},,{"CEST-04-\
> E-04",,"52",,"3e-07"},,{"CEST-28-H-03",,"50",,"1e-06"},,{"CEST-46-G-10",,"48",\
> ,"5e-06"},,{"CEST-37-B-11",,"48",,"5e-06"},,{"CEST-21-D-05",,"48",,"5e-06"},,{\
> "CEST-21-A-11",,"48",,"5e-06"},,{"CEST-21-A-10",,"48",,"5e-06"},,{"CEST-19-G-\
> 12",,"48",,"5e-06"},,{"CEST-13-F-07",,"48",,"5e-06"},,{"CEST-10-E-05",,"48",,\
> "5e-06"},,{"CEST-04-E-08",,"48",,"5e-06"},,{"CEST-60-C-12",,"46",,"2e-05"},,{\
> "CEST-59-D-02",,"46",,"2e-05"},,{"CEST-29-A-06",,"46",,"2e-05"},,{"CEST-26-H-\
> 10",,"46",,"2e-05"},,{"CEST-25-F-11",,"46",,"2e-05"},,{"CEST-20-C-11",,"46",,\
> "2e-05"},,{"CEST-19-F-10",,"46",,"2e-05"},,{"CEST-11-E-06",,"46",,"2e-05"}}}
>
> (1) Is there a way to export my original "nice"
> looking list (the temp2 list), so that it will import
> in exactly the same?
>
> (2) Even though the Head of each element in both the
> "temp2" and "tempsub" lists are Strings, why does
> Mathematica put extra quotation marks around the newly
> imported list items and not the original list items?
>
>
> Whew, I am outta breath.  Any thoughts or suggestions
> where I might find useful information?  As
> always,thank you to the numerous people who have
> helped me out in the past.  This is an excellent forum
> for learning Mathematica.
>
> Best regards,
> Todd
>
>
>
>
>
> 		
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>
>
>
>



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Re: Re: finite domains
  • Next by Date: Re: Mathematica is destroying my sanity....
  • Previous by thread: Mathematica is destroying my sanity....
  • Next by thread: Re: Mathematica is destroying my sanity....