Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 206501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:39:06+00:00 2026-05-11T17:39:06+00:00

I have a .txt file like: Symbols from __ctype_tab.o: Name Value Class Type Size

  • 0

I have a .txt file like:

Symbols from __ctype_tab.o:

Name                  Value   Class        Type         Size     Line  Section

__ctype             |00000000|   D  |       OBJECT   |00000004|     |.data
__ctype_tab         |00000000|   r  |       OBJECT   |00000101|     |.rodata


Symbols from _ashldi3.o:

Name                  Value   Class        Type         Size     Line  Section

__ashldi3           |00000000|   T  |       FUNC      |00000050|     |.text

How can i parsr this file and get the functions with type FUNC ?
Also,from this txt how can i parse and extract .o name ?

How can i get them by column wise parsing or else how.

I need an immediate help…Waiting for an appropriate solution as usual

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:39:06+00:00Added an answer on May 11, 2026 at 5:39 pm

    I think this might cost less than the use of regexes though i am not totally clear on what you are trying to accomplish

    symbolList=[]
    for line in open('datafile.txt','r'):
    if '.o' in line:
        tempname=line.split()[-1][0:-2]
                pass
    
    if 'FUNC' not in line:
        pass
    
    else:
        symbolList.append((tempname,line.split('|')[0]))
    

    I have learned from other posts it is cheaper and better to wrap up all of the data when you are reading through a file the first time. Thus if you wanted to wrap up the whole datafile in one pass then you could do the following instead

    fullDict={}
    for line in open('datafile.txt','r'):
        if '.o' in line:
            tempname=line.split()[-1][0:-2]
        if '|' not in line:
            pass
        else:
            tempDict={}
                dataList=[dataItem.strip() for dataItem in line.strip().split('|')]
                name=dataList[0].strip()
                tempDict['Value']=dataList[1]
                tempDict['Class']=dataList[2]
                tempDict['Type']=dataList[3]
                tempDict['Size']=dataList[4]
                tempDict['Line']=dataList[5]
                tempDict['Section']=dataList[6]
                tempDict['o.name']=tempname
                fullDict[name]=tempDict
                tempDict={}
    

    Then if you want the Func type you would use the following:

    funcDict={}
    for record in fullDict:
        if fullDict[record]['Type']=='FUNC':
            funcDict[record]=fullDict[record]
    

    Sorry for being so obsessive but I am trying to get a better handle on creating list comprehensions and I decided that this was worthy of a shot

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have sth like that inside *.txt file. function_name({one: {id: id_for_one, value: value_for_one}, ...});
I have a txt file with numbers like 541399.531 261032.266 16.660 (first line) 541400.288
I have a txt file like so: This is line 1. This is line
I have a CMakeLists.txt file that looks like this: add_executable(exec1 exec1.c source1.c source2.c source3.c)
I have a ID.txt file that looks like this: http://something.net/something-ak/41389_718783565_1214898307_q.jpg http://something.net/something-ak/372142_106502518141813_1189943482_q.jpg and so on
Imagine I have a txt file with a path like: c:\programs\SRC_CODE\ How can I
I have a log.txt file on the root of my application. I would like
I have to read a txt file with lines formated like this: 1: (G,
I have a file like this. rm a.txt mkdir foo cp a.doc docs I
I have a java.hprof.txt file (automatically generated after an OutOfMemoryError) which I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.