Re: ReadList query
- To: mathgroup at smc.vnet.net
- Subject: [mg27805] Re: ReadList query
- From: Lawrence Walker <lwalker701 at earthlink.net>
- Date: Fri, 16 Mar 2001 04:38:03 -0500 (EST)
- Organization: Morgan State University: COMSARE
- References: <98cgri$g2m@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Bob, You can try the following. (* I interpreted your list as numbers separated by both ',' and ';'. *) data=ReadList[<enterfilename>,Word,WordSeparators->{",",";"}]; (* Note - I didn't test this code - you might have to convert the above from a list of strings to a list of numbers by using the ToExpression command before going to the next step since you can't do computations with strings. But if your list contains numbers in fortran notation then you can use StringToStream[] which is a little but tricky to deal with. *) data2=Partition[data,3]; Map[{#[[1]],#[[2]]*10+#[[3]]}&,data2] Hope this helps, Lawrence Robert-Lewis HYDE wrote: > Help please, > > I have a long series of data as; > > 3000; 2,3; 3000; 3,5; ........... > > I would like to Read this as > > {{3000, 2.3},{3000, 3.5},...........}} > > in order to Plot etc. > > What is the code please ? > > bob -- ------------------------------------------------------------ (\___/) The fear of the LORD is the beginning of (o\ /o) wisdom: a good understanding have all they /|:.V.:|\ that do his commandments: his praise \\:::::// endureth for ever. Psa 111:10 -----`"" ""`------------------------------------------------ Lawrence A. Walker Jr., M.Eng./Ph.D. Candidate Morgan State University Clarence M. Mitchell School of Engineering COMSARE (Center Of Microwave/Satellite And RF Engineering) (443)885-1453 ------------------------------------------------------------