Hello all, I am completely new to python, but unfortunately a professor I am working for needs some code done in it. Basically, I need to look through a file for the word "DATA" and then perform some manipulations (simple algebra) do a long list of numbers (3900 to be exact) after that. I think I can figure out the algebraic stuff with some for loops, but I cant seem to figure out how to make a program search for a word and start reading after that. Any help would be greatly appreciated.
sniperx99
0
Newbie Poster
Recommended Answers
Jump to PostSince we don't have your data file, we can simply create a sample test file and use that to show you how you can extract the numeric data after the marker ...
# create a test data string raw_data = """\ a b c DATA 11 22 …
All 3 Replies
txwooley
0
Junior Poster in Training
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
sniperx99
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.