Message Boards Message Boards

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

curve, data ,import

Posted 9 years ago
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
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