1. Weiterleitung zu NetzLiving.de
  2. Forum
    1. Unerledigte Themen
  3. zum neuen Forum
  • Anmelden
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Seiten
  • Forum
  • Erweiterte Suche
  1. Informatik Forum
  2. Webmaster & Internet
  3. Entwicklung

Haskell

    • Frage
  • rose1000
  • 23. April 2006 um 18:20
  • Unerledigt
Hallo zusammen,

das Informatik-Forum geht in den Archivmodus, genaue Informationen kann man der entsprechenden Ankündigung entnehmen. Als Dankeschön für die Treue bekommt man von uns einen Gutscheincode (informatikforum30) womit man bei netzliving.de 30% auf das erste Jahr sparen kann. (Genaue Infos sind ebenfalls in der Ankündigung)

Vielen Dank für die Treue und das Verständnis!
  • rose1000
    Punkte
    20
    Beiträge
    3
    • 23. April 2006 um 18:20
    • #1

    Hi to all,
    i am a newbie in Haskell, and it has recently become my nightmare.. i have several years of programming experince, but i have never been stuck like this..
    please share your knowlodge, if you have any about my problem.. so here is my basic and first problem;
    i have a text file and lines in it, i need to get the contents of the file line by line to a list in my program..

    Then i will process the list in some way this is not the deal.. the big deal is how do i get the contents of the file line by line to a list !?
    i will appreciate any help.. Thanks..




    (Ich kann Deutsch nicht ganz erklären, deshalb musste ich Egnlisch geschrieben)

  • Spockman
    Punkte
    210
    Beiträge
    41
    • 24. April 2006 um 02:10
    • #2
    Zitat von rose1000


    i have a text file and lines in it, i need to get the contents of the file line by line to a list in my program..

    Code
    main = do
      c <- getContents
      let ls0 = lines c
      let ls1 = map process_line ls0
      putStr (unlines ls1)
    
    
    process_line xs = drop 3 xs


    Now:

    $ cat txt
    1232652
    20aeusatheou
    3209625209856
    aoeu',l.cry,'rcg

    $ cat txt | runhugs test.hs
    2652
    eusatheou
    9625209856
    u',l.cry,'rcg

  • rose1000
    Punkte
    20
    Beiträge
    3
    • 24. April 2006 um 16:47
    • #3

    vielen dank

    mfG

  • Maximilian Rupp 27. Dezember 2024 um 12:06

    Hat das Thema aus dem Forum Programmieren nach Entwicklung verschoben.

  1. Datenschutzerklärung
  2. Impressum