Message Boards Message Boards

0
|
4440 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

curve, data ,import

Posted 9 years ago

Hello, How to use this set of data for curve analysis. I can use interpolation but this data looks a bit difficult for me after an import. Also how to convert this a matrix and reach to each Colum. A simple import and matrix from does not work as there are issue of comma in list,

Time Area 1 Area 2 Temp(xx,yy degree Celsius) 00:00:00, 037 32,17 34,96

here 32,17 is 32.17 Please go through attachment. Thanks in advance.

Attachments:
POSTED BY: Alexia werk
6 Replies
Posted 9 years ago

.

Map[Flatten[{StringDrop[#[[1]], -1], #[[2]], ToExpression[Drop[#, 2]]}] &, 
 StringSplit[Rest[StringSplit[StringReplace[Import["testdata.txt"], "," -> "."], "\n"]], "\t"]]
POSTED BY: Bill Simpson
Posted 9 years ago

please help me to modify the attached file like below

{{00:00:00 037 32.17 34.96}, {00:00:00 074 32.17 34.96}, {00:00:00 111 32.17 34.96}, {00:00:00 148 32.17 34.96}, {00:00:00 037 32.17 34.96}, {00:00:00 074 32.17 34.96}]

Attachments:
POSTED BY: Alexia werk
Posted 9 years ago

Perhaps a little format hacking is in order

In[1]:= Map[Flatten[{DateString[AbsoluteTime[First[#]]], ToExpression[Rest[#]]}] &, 
    StringSplit[Rest[StringSplit[StringReplace[Import["testdata.txt"], "," -> "."], "\n"]], "\t"]]

Out[1]= {
   {"Thu 1 Jan 2015 00:00:00", 37, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 74, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 111, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 148, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 37, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 74, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 111, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 148, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 185, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 222, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:00", 259, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:01", 296, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:02", 333, 32.17, 34.96},
   {"Thu 1 Jan 2015 00:00:03", 370, 32.17, 34.96}}

I'm not exactly certain how you want to apply the data, but perhaps with a little study you can see how to adapt this.

If that isn't enough then perhaps you can show one line of input and the needed output form of that.

POSTED BY: Bill Simpson
Posted 9 years ago

thanks

POSTED BY: Alexia werk
Posted 9 years ago

Thats nice but please look to my attachment, I have to process such files. I use StringReplace[Import["testdata.txt"], "," -> "."] // Table

00:00:00. 037 32.17 34.96 00:00:01. here in this numerical line 00:00:00. how to remove . from the end, Its 100 page long data.

POSTED BY: Alexia werk
Posted 9 years ago

Look at this.. change the path of file..

Attachments:
POSTED BY: Okkes Dulgerci
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract