473,378 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Return lines in file that match string

I am new to python and could use some help with a fairly easy task. I
would like to return all lines in a file that have the string
'<coordinates>' to a list.

Regards,

--
Travis K.

Toronto, Canada
------------------------------------------------------------
"She knows there's no success like failure
And that failure's no success at all."
-Bob Dylan-
------------------------------------------------------------
Oct 28 '08 #1
0 755

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew Rich | last post by:
Howdy, I have a need to do this :- 1. find a match 2. go back three lines 3. read out lines 1 2 3 eg
26
by: Shannon Jacobs | last post by:
Sorry to ask what is surely a trivial question. Also sorry that I don't have my current code version on hand, but... Anyway, must be some problem with trying to do the negative. It seems like I get...
19
by: Alex Vinokur | last post by:
Is there any tool to count C-program lines except comments? Thanks, ===================================== Alex Vinokur mailto:alexvn@connect.to http://mathforum.org/library/view/10978.html...
4
by: Psibur | last post by:
Hello, trying to get back into c and was having issue with reading a simple text file with an aribtrary # of lines with 3 int's per line, with the eventual purpose of putting each int into an...
5
by: Jeremy R. Harner | last post by:
I've been trying to figure out this for many hours now. I have a file that is in the following format: Game #xxxxxxxxx stuff stuff stuff stuff stuff -----------------------------
1
by: jef.d | last post by:
I am attempting to read through a text file & then update an HTML page table w/ the output from the text file (ie; statusing by table). What I want the code to do is read through the file, look...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4. I'm reading the contents of a file and then trying to extract contents between two string tokens. Problem is, tokens occur on different lines. It seems that regular...
0
by: Chris Rebert | last post by:
On Tue, Oct 28, 2008 at 11:37 AM, Travis Kirstine <traviskirstine@gmail.comwrote: from __future__ import with_statement with open('path/to/file') as f: desired_lines = For your reference,...
2
by: rka77 | last post by:
Hi, I am trying to make a Python2.6 script on a Win32 that will read all the text files stored in a directory and print only the lines containing actual data. A sample file - Set : 1 Date:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.