For each clg what is the last rank for bds-govt and bds private
cd /tmp/workspace && python3 << 'EOF' import pdfplumber import re from collections import defaultdict pdf_path = "/tmp/workspace/attachments/c48813da-810e-487d-9f95-1a6a9116258f/UGNEET_ALLOT_2025_R2_prov_2ND_PROV_DEN_10092025kannada.pdf" with pdfplumber.open(pdf_path) as pdf: print(f"Total pages: {len(pdf.pages)}") # Print first 2 pages to understand structure for i in range(min(3, len(pdf.pages))): print(f"\n=== PAGE {i+1} ===") text = pdf.pages[i].extract_text() if text: print(text[:3000]) EOF
python3 << 'EOF' import pdfplumber import re from collections import defaultdict pdf_path = "/tmp/workspace/attachments/c48813da-810e-487d-9f95-1a6a9116258f/UGNEET_ALLOT_2025_R2_prov_2ND_PROV_DEN_10092025kannada.pdf" # Data structure: {college_name: {course_type: max_rank}} college_data = defaultdict(lambda: {"BDS-GOVT.": 0, "BDS-PRIV.": 0}) with pdfplumber.open(pdf_path) as pdf: all_text = "" for page in pdf.pages: text = page.extract_text() if text: all_text += text + "\n" # Parse lines lines = all_text.split('\n') # We need to identify rows: SL.NO | RANK | COURSE_CODE | COLLEGE_NAME | COURSE_NAME | FEES | STATUS # Pattern: line starts with a number (SL), followed by rank, code, college, course # Let's try a regex approach to capture each entry # Typical line format (may span multiple lines due to long college names): # <sl_no> <rank> <code> <college_name> BDS-GOVT./BDS-PRIV. <category> <fees> <status> # Rebuild multi-line entries # Strategy: find blocks starting with a digit (sl no), ending before next sl no import re # Extract all entries using regex # The pattern: number, space, number (rank), space, code (D\w+), then college name, then BDS-GOVT. or BDS-PRIV. pattern = re.compile( r'(\d+)\s+(\d+)\s+(D\d+D[GP])\s+(.*?)\s+(BDS-(?:GOVT|PRIV)\.)\s+(\w+)\s+(\d+)\s+(\w+)', re.DOTALL ) # Actually let's parse line by line more carefully # Each entry has: SL, Rank, CourseCode, CollegeName (multiline), CourseName, Category, Fees, Status # Better approach: find all rank+course combinations # Look for patterns like: number TAB/spaces number TAB/spaces D-code entries = [] # Join all text and use a comprehensive regex full_text = all_text # Pattern to match each row # SL.NO, Rank, CourseCode are on one line usually # Then college name (possibly multi-line) # Then BDS-GOVT. or BDS-PRIV. on a line # Let's find all occurrences of BDS-GOVT. and BDS-PRIV. with context bds_pattern = re.compile(r'(\d+)\s+(D\d+D[GP])\s+(.*?)(BDS-(?:GOVT|PRIV)\.)', re.DOTALL) # Better: extract line by line and find the pattern # Each page has consistent format - let's extract tables # Re-approach: for each page extract tables all_rows = [] with pdfplumber.open(pdf_path) as pdf: for page_num, page in enumerate(pdf.pages): # Try table extraction tables = page.extract_tables() if tables: for table in tables: for row in table: if row: all_rows.append(row) else: # fallback to text text = page.extract_text() if text: pass print(f"Total rows from tables: {len(all_rows)}") if all_rows: print("First 5 rows:") for r in all_rows[:5]: print(r) EOF
python3 << 'EOF' import pdfplumber from collections import defaultdict pdf_path = "/tmp/workspace/attachments/c48813da-810e-487d-9f95-1a6a9116258f/UGNEET_ALLOT_2025_R2_prov_2ND_PROV_DEN_10092025kannada.pdf" # {college_name: {course_type: max_rank}} college_data = defaultdict(lambda: {"BDS-GOVT.": None, "BDS-PRIV.": None}) all_rows = [] with pdfplumber.open(pdf_path) as pdf: for page in pdf.pages: tables = page.extract_tables() if tables: for table in tables: for row in table: if row and len(row) >= 7: all_rows.append(row) print(f"Total rows: {len(all_rows)}") # Skip header rows data_rows = [] for row in all_rows: # Skip header rows if row[0] and row[0].strip().upper() in ('SL.NO', 'SL NO', 'SL', ''): continue if row[0] and 'SL' in str(row[0]).upper(): continue try: sl = int(str(row[0]).strip()) rank = int(str(row[1]).strip()) college = str(row[3]).replace('\n', ' ').strip() course = str(row[4]).strip() data_rows.append((sl, rank, college, course)) except (ValueError, TypeError): continue print(f"Data rows parsed: {len(data_rows)}") # For each college, find the MAXIMUM rank (last rank = highest rank number = hardest to get) for sl, rank, college, course in data_rows: if course in ("BDS-GOVT.", "BDS-PRIV."): current = college_data[college][course] if current is None or rank > current: college_data[college][course] = rank # Print results print("\n" + "="*120) print(f"{'College':<65} {'BDS-GOVT Last Rank':>20} {'BDS-PRIV Last Rank':>20}") print("="*120) colleges = sorted(college_data.keys()) for col in colleges: govt = college_data[col]["BDS-GOVT."] priv = college_data[col]["BDS-PRIV."] govt_str = str(govt) if govt else "-" priv_str = str(priv) if priv else "-" print(f"{col:<65} {govt_str:>20} {priv_str:>20}") EOF
python3 << 'EOF' import pdfplumber from collections import defaultdict import csv, os pdf_path = "/tmp/workspace/attachments/c48813da-810e-487d-9f95-1a6a9116258f/UGNEET_ALLOT_2025_R2_prov_2ND_PROV_DEN_10092025kannada.pdf" college_data = defaultdict(lambda: {"BDS-GOVT.": None, "BDS-PRIV.": None}) all_rows = [] with pdfplumber.open(pdf_path) as pdf: for page in pdf.pages: tables = page.extract_tables() if tables: for table in tables: for row in table: if row and len(row) >= 7: all_rows.append(row) for row in all_rows: if row[0] and ('SL' in str(row[0]).upper() or 'sl' in str(row[0]).lower()): continue try: sl = int(str(row[0]).strip()) rank = int(str(row[1]).strip()) college = str(row[3]).replace('\n', ' ').strip() course = str(row[4]).strip() if course in ("BDS-GOVT.", "BDS-PRIV."): current = college_data[college][course] if current is None or rank > current: college_data[college][course] = rank except (ValueError, TypeError): continue os.makedirs("/tmp/workspace/output", exist_ok=True) out_path = "/tmp/workspace/output/BDS_LastRank_ByCollege.csv" with open(out_path, "w", newline="") as f: writer = csv.writer(f) writer.writerow(["College Name", "BDS-GOVT Last Rank", "BDS-PRIV Last Rank"]) for col in sorted(college_data.keys()): govt = college_data[col]["BDS-GOVT."] or "-" priv = college_data[col]["BDS-PRIV."] or "-" writer.writerow([col, govt, priv]) print(f"CSV saved to {out_path}") EOF
Note: "Last Rank" = the highest (worst) rank that still got a seat. A "-" means no seat of that type was allotted at that college in this round.
| # | College | BDS-GOVT Last Rank | BDS-PRIV Last Rank |
|---|---|---|---|
| 1 | A.J. Institute of Dental Sciences, Mangalore | 4,92,704 | 13,02,726 |
| 2 | Academy of Medical Education Dental College, Raichur | 4,68,291 | 11,87,681 |
| 3 | Al Badar Dental College and Hospital, Gulbarga | 8,09,852 | 13,17,239 |
| 4 | Al-Ameen Dental College, Bijapur | 4,98,654 | 7,65,855 |
| 5 | BGS Global Institute of Dental Sciences, Bangalore | 3,25,078 | 6,08,831 |
| 6 | Bangalore Institute of Dental Sciences, Bangalore | 3,39,143 | 12,91,363 |
| 7 | Bapuji Dental College and Hospital, Davangere | 3,18,027 | 5,09,253 |
| 8 | College of Dental Sciences, Davangere | 5,86,760 | 8,42,387 |
| 9 | Coorg Institute of Dental Sciences, Coorg | 3,29,327 | 12,69,016 |
| 10 | Dayananda Sagar College of Dental Sciences, Bangalore | 3,30,148 | 9,80,223 |
| 11 | Dr. M.R. Ambedkar Dental College, Bangalore | 3,49,756 | 11,52,281 |
| 12 | Employees State Insurance Corporation Dental College, Gulbarga | 2,97,034 | - |
| 13 | FAROOQUIA Dental College, Mysore | 5,04,046 | 8,39,504 |
| 14 | Government Dental College & Research Institute, Bellary | 4,20,063 | - |
| 15 | Government Dental College, Victoria Hospital, Bangalore | 9,73,505 | - |
| 16 | HKDET'S Dental College Hospital, Bidar | 6,92,080 | 10,71,155 |
| 17 | Hyderabad Karnataka Education Society Dental College, Gulbarga | 5,30,311 | 6,35,459 |
| 18 | K.L.E.S. Institute of Dental Sciences, Bangalore | 3,57,854 | 9,62,014 |
| 19 | K.G.F. College of Dental Sciences, KGF | 3,22,342 | 13,17,693 |
| 20 | K. Venkataramana Gowda Dental College, Dakshina Kannada | 8,10,005 | 12,86,233 |
| 21 | Krishnadevaraya College of Dental Sciences, Bangalore | 5,37,570 | 9,46,382 |
| 22 | M.S. Ramaiah University of Applied Sciences, Bangalore | 3,12,532 | 5,45,485 |
| 23 | Maratha Mandal Dental College, Belgaum | 6,62,981 | 10,77,938 |
| 24 | Navodaya Dental College, Raichur | 5,37,608 | 12,35,200 |
| 25 | Oxford Dental College, Bangalore | 4,21,731 | 10,80,011 |
| 26 | PM Nadagowda Memorial Dental College, Bagalkot | 4,09,437 | 11,78,613 |
| 27 | Raja Rajeshwari Dental College, Bangalore | 6,22,680 | 9,92,939 |
| 28 | Rashtreeya Vidyalaya Dental College, Bangalore | 3,52,225 | 9,20,773 |
| 29 | S.B. Patil Institute for Dental Sciences, Bidar | 5,74,551 | 11,03,157 |
| 30 | Sharavathi Dental College, Shimoga | 6,77,255 | 10,47,329 |
| 31 | Sri Dharmasthala Manjunatheswara Dental College, Dharwad | 4,25,739 | 5,95,656 |
| 32 | Sri Jagadguru Murugharajendra Dental College, Chitradurga | 5,17,841 | 9,21,724 |
| 33 | Sri Rajiv Gandhi Dental College, Bangalore | 4,42,136 | 12,93,885 |
| 34 | Sri Hasanamba Dental College, Hassan | 4,17,423 | 8,02,822 |
| 35 | Srinivasa Institute of Dental Science, Mangalore | 5,08,026 | 13,13,858 |
| 36 | Subbaiah Institute of Dental Sciences, Shimoga | 7,02,568 | 10,26,257 |
| 37 | Venkateswara Dental College, Bangalore | 3,38,201 | 10,47,914 |
| 38 | Vokkaligara Sangha Dental College, Bangalore | 4,57,618 | 11,50,379 |
| 39 | Vydehi Institute of Dental Sciences, Bangalore | 3,79,680 | 12,57,608 |
BDS LastRank ByCollege
CSV File · CSV
Make this as appt
Make this as a ppt
Make this as a pdf
For each clg what is last rank for bds -govt 2AG and bds private-GMP