Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 60113
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to find a String inside a String?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!