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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:49:02+00:00 2026-06-14T18:49:02+00:00

My goal is to ask a user for a date, then scan through the

  • 0

My goal is to ask a user for a date, then scan through the cell values of a spreadsheet column and return any cells that start with that date.

I have a spreadsheet in which the first column is a list of timestamps (e.g., 10/29/2012 “9:10:12”). I’m using Python and gpsread to access the Google spreadsheet.

import gspread
import re

gc = gspread.login('username', 'password') # login
wks = gc.open('googleSpreadsheet').sheet1 # open spreadsheet

I’m trying to ask the user for a date input like this:

dateInput = str(raw_input('Date? (MM/DD/YYYY) '))

I then want to take that input and use it in a regular expression to find all the cells that start with it:

amount_re = re.compile(r'(^dateInput)')
cell_list = wks.findall(amount_re)

but that returns an empty array.

So, how do I take a user input and return any cells that start with that input? Ultimately, I want to be able to find any cells in the spreadsheet that have a given date, then copy and paste the corresponding rows to a different spreadsheet. This first part of parsing through the data and storing the cells is where I’m hung up.

  • 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-14T18:49:03+00:00Added an answer on June 14, 2026 at 6:49 pm

    If you’re actually pulling the user input in the way you’ve presented, the problem might be a trailing newline. Try:

    dateInput = raw_input("Date? (MM/DD/YYYY) ").strip()
    amount_re = re.compile(r"(^%s)" % (dateInput,))
    cell_list = wks.findall(amount_re)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal: to create a percentage column based off the values of calculated columns. Here's
Some of our customers ask for end-user documentation in a format that’s suitable for
My app is a goal-setting workshop. The user describes his life goals, and then
My goal is to simply use a pop-up box to ask the user for
I have a web form that ask a user for their Id. My overall
I wanted to ask if there is any alternative to JavaScript/AJAX. My goal is
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal: Once i click on the start button on my user interface, i currently
Goal: Produce an Excel document with information from 3 associated models that is similar
GOAL : To customize the background view of cell. Here is what I am

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.