0
$\begingroup$

I am working in a data set : The original question, They are strings of thousands stars,and each one contains a lot of parameters, and the following item is called identifies, they are the names (nomenclatures) that a specific star can have in diverse catalogues.

And I need to take the "wordcharaters + numbers " in this string:

"Identifiers (30):
   ALS 3038                        CD-55 5094                      CEL 4238                      
   CPC 19 5018                     CPD-55 5504                     EM* CDS 875                   
   FK5 3065                        GC 18036                        GCRV 64023                    
   GEN# +1.00115842                GSC 08666-01844                 HD 115842                     
   HIC 65129                       HIP 65129                       HR 5027                       
   IRAS 13176-5532                 JP11 2383                       LS 3038                       
   MCW 1248                        NSV 6193                        PPM 341819                    
   ROT 7259                        SAO 240765                      SKY# 24643                    
   TD1 16778                       TYC 8666-1844-1                 UBV 12039                     
   UBV M 19272                     uvby98 100115842                2MASS J13204833-5548026       

Notes (0) :"

As follows:

   { ALS 3038, CD-55 5094,CEL 4238,CPC 19 5018,...}

So I can apply the code to get these names for thousands stars from my dataset: the original question.

And generate a kind of association or DataSet[], as ex. : identifiers (is one of many parameters I have to take):

{{star ...., identifiers-> name1, name2,name 3...},{star...,identifiers-> name1, name2, etc...}}
$\endgroup$
  • $\begingroup$ Could you please clarify what is the actual question here? This site is not just for presentation of your current projects. $\endgroup$ – Oleksandr R. Dec 27 '14 at 12:44
  • $\begingroup$ I am not presenting my project, I am having some difficulties to get pieces of information. And I am asking for help, I do not understand why you think I am presenting my projects, as everyone in this forum has question related to his "projects" also. $\endgroup$ – locometro Dec 27 '14 at 12:49
  • $\begingroup$ You say "I am working", "I need", but not "how can I do...?" or "what is wrong with [given code]?" What exactly do you want us to do for you here? $\endgroup$ – Oleksandr R. Dec 27 '14 at 12:54
  • $\begingroup$ ok, I see that you have issues with the semantics. So yes, "How can I get the names from the identifiers in a string", is it ok for you, now? $\endgroup$ – locometro Dec 27 '14 at 12:57
  • $\begingroup$ Yes, that's clear now, thank you. Just one other thing: why are you using the associations tag when you admit in the other question that you don't know how they work or whether they are even appropriate here? I would suggest tags like programming or string-manipulation instead. Remember that posts on SE sites are expected to be useful for many people into the future, not just for the temporary benefit of the OP. $\endgroup$ – Oleksandr R. Dec 27 '14 at 12:59
1
$\begingroup$
    q = Import["Teste_dataMining.txt"];
    identifiersPositions = StringPosition[q,"Identifiers (" ~~ CharacterRange["0", "9"] .. ~~ "):"];
notes = StringPosition[q,"Notes (" ~~ CharacterRange["0", "9"] .. ~~ ") :"];
identifiers = StringTake[q, Transpose[{identifiersPositions[[All, 2]] + 1, 
    notes[[All, 1]] - 1}]];
StringSplit[identifiers, Whitespace ~~ Whitespace ..]
(*{{"ALS 3038", "CD-55 5094", "CEL 4238", "CPC 19 5018", "CPD-55 5504", 
  "EM* CDS 875", "FK5 3065", "GC 18036", "GCRV 64023", 
  "GEN# +1.00115842", "GSC 08666-01844", "HD 115842", "HIC 65129", 
  "HIP 65129", "HR 5027", "IRAS 13176-5532", "JP11 2383", "LS 3038", 
  "MCW 1248", "NSV 6193", "PPM 341819", "ROT 7259", "SAO 240765", 
  "SKY# 24643", "TD1 16778", "TYC 8666-1844-1", "UBV 12039", 
  "UBV M 19272", "uvby98 100115842", 
  "2MASS J13204833-5548026"}, {"CD-51 7465", "CEL 4244", 
  "CPC 19 5027", "CPD-51 6012", "GC 18081", "GCRV 7935", 
  "GEN# +1.00116084", "GSC 08260-01811", "HD 116084", "HIC 65247", 
  "HIP 65247", "HR 5036", "N30 3060", "PPM 341837", "SAO 240782", 
  "SKY# 24684", "TYC 8260-1811-1", "UBV M 19298", "[B10] 3458", 
  "uvby98 100116084", "2MASS J13221628-5210586", "ALS 14978"}}*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.