0

I have a text file including following text

zts1e   Generelle Effekte
zts2e   Magische Effekte
zts3e   Gift Serie
zts4e   Krankheitsserie
zts5e   Aufladungs Serie

And what to do if I want to have the second part of the 1st line ("Generelle Effekte") and (ex.) the 2nd part of the 2nd line ("Magische Effekte") and so on?

I mean I have parsed a long time ago something else but I don't know how to manage it.

Could you help please?

Joseph Mansfield
  • 100,738
  • 18
  • 225
  • 303
IceTrailer
  • 145
  • 11
  • 1
    *Please* show us what you've already tried. At least do some research by yourself. (Even just opening the file, for starters.) – Jashaszun Jul 24 '14 at 19:42
  • 1
    Depends on exactly what the format of the file is. You have to define that first. Is it always 5 characters, a tab, then the rest is a second field? Or is it some arbitrary number of alphanumerical characters, some arbitrary white space, and then the rest of the text? Or something else? – Joseph Mansfield Jul 24 '14 at 19:42
  • 1
    [This](http://stackoverflow.com/questions/14265581/parse-split-a-string-in-c-using-string-delimiter-standard-c) will do this for any line format. Just use `tab` or `space` as a delimiter. – Florin Stingaciu Jul 24 '14 at 19:44
  • this is a txt-file, and between the string name "ztsXe" and the German text is always a tab. It goes on with ztse descending. The German text is some times one word, sometimes to, sometimes some more. – IceTrailer Jul 24 '14 at 19:50
  • 1
    First you divide the file by lines (`\n` or `\r\n`, depending of the platform you're using) and it creates an array of lines. Then you divide each line by `\t` (if the space between the two texts is a tabulator) and you can place it to a hashmap for example, so you will get an array of elements with key consisting of the first text, and corresponding value as the second text. – sobol6803 Jul 24 '14 at 20:34

0 Answers0