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 8000395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:46:51+00:00 2026-06-04T15:46:51+00:00

I have a csv file which has 3 columns. I am trying to search

  • 0

I have a csv file which has 3 columns. I am trying to search through the second column for a specific value (hex values) and read the next entry over in that line (column 3). The format is similar to the below:

Text1,  0x04d0a053, value1
Text2,  0x04d01053, value2
Text3,  0x04d03053, value3
Text4,  0x04d05053, value4
Text5,  0x04d00053, value5
Text6,  0x04d02053, value6
Text7,  0x04d04053, value7
Text8,  0x04413053, value8

I have no problem searching and reading the last value (0x04413053) and printing ‘value8’. However, when I attempt to search for any of the first 7 entries nothing is read back ([] on the output). My code is below, anyone have an idea of what the bug might be?

fileInput = 'mycsv.csv'
column0 = 0
column1 = 1
column2 = 2

#reads correctly
hexvalue = hex(0x04413053)
with open(fileInput, 'r') as file:
  reader = csv.reader(file)
  entry = [line[column2] for line in reader if line[column1] == hexvalue]
  print entry

#does not read correctly
hexvalue = hex(0x04d0a053)
with open(fileInput, 'r') as file:
  reader = csv.reader(file)
  entry = [line[column2] for line in reader if line[column1] == hexvalue]
  print entry
  • 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-06-04T15:46:53+00:00Added an answer on June 4, 2026 at 3:46 pm

    hex(0x 0 4413053) is “0x4413053”

    You should probably do the inverse, i.e.

    int(line[clolumn1], 16) == 0x04413053
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an input csv file with columns position_Id, Asofdate, etc which has to
I have a csv file which has two columns, a numeric ID ( IDVAR
I have a CSV file which has a column for time and the time
I have CSV file which has timestamp in the first column as shown below
I have two columns in a csv file, one of which has the time
I have a CSV file which has the following format: id,case1,case2,case3 Here is a
I have a CSV file which contains an ID and several other columns. I
I have a csv file with 350,000 rows, each row has about 150 columns.
I have a csv file which has a word for each row like this
I have a csv file that has 2 columns separated by a comma -

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.