Author Topic: crate arrays from text file  (Read 175 times)

0 Members and 1 Guest are viewing this topic.

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • View Profile
crate arrays from text file
« on: June 30, 2010, 10:37:23 AM »
I have a text file with a lot of lines. Need to make each new line in the text file a new part of an array so I can loop through and remove everything except the first 5 characters. Unless there is a way to just remove everything except the first 5 characters of each line, they will also need a comma added to the end of them. If I get them in an array I can do whatever I need though.
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.

Offline kenrbnsn

  • Guru
  • Freak!
  • *
  • Posts: 9,708
  • Gender: Male
    • View Profile
Re: crate arrays from text file
« Reply #1 on: June 30, 2010, 10:46:22 AM »
Take a look at the file() function.

Ken

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • View Profile
Re: crate arrays from text file
« Reply #2 on: June 30, 2010, 10:49:13 AM »
haha thanks, didn't realize it was that simple.
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.