Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Read and search for text in a file  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a file like this
ABCD 123 blah blah
int varx;
string varb;

xyz = varb;

blah blah

What I need to do:
search in the file for xyz and find varb and then find
string varb;
and extract what it is a string.

so the definition of varb is before it is used, so I need to find if it is used and then find what it is defined as.

How do I do this? The file will be Unix formatted but stored locally on a DOS machine.
Thanks
 
Marshal
Posts: 63326
205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to find a String inside a String?
 
Something must be done about this. Let's start by reading this tiny ad:
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!