Military tb full details for md exam answer 15 marks from this pdf and your data
cd /home/daytona/workspace/attachments/b0037aea-213e-4617-803c-56917302248c/ && python3 -c " import pdfplumber import re pdf_path = 'Sharma mohan latest_compressed-compressed (1).pdf' with pdfplumber.open(pdf_path) as pdf: print(f'Total pages: {len(pdf.pages)}') # Search for military TB content for i, page in enumerate(pdf.pages): text = page.extract_text() if text and ('military' in text.lower() or 'miliary' in text.lower()): print(f'=== PAGE {i+1} ===') print(text[:3000]) print() " 2>&1 | head -300
"miliary tuberculosis" diagnosis treatment
cd "/home/daytona/workspace/attachments/b0037aea-213e-4617-803c-56917302248c/" && python3 -c " import pdfplumber pdf_path = 'Sharma mohan latest_compressed-compressed (1).pdf' with pdfplumber.open(pdf_path) as pdf: print(f'Total pages: {len(pdf.pages)}') # Print first 3 pages to understand structure for i in range(min(3, len(pdf.pages))): text = pdf.pages[i].extract_text() if text: print(f'=== PAGE {i+1} ===') print(text[:500]) " 2>&1
python3 -c " import pdfplumber pdf_path = '/home/daytona/workspace/attachments/b0037aea-213e-4617-803c-56917302248c/Sharma mohan latest_compressed-compressed (1).pdf' with pdfplumber.open(pdf_path) as pdf: total = len(pdf.pages) print(f'Total pages: {total}') # Search all pages for miliary results = [] for i, page in enumerate(pdf.pages): text = page.extract_text() if text and ('miliar' in text.lower()): results.append((i+1, text)) print(f'Found miliary content on pages: {[r[0] for r in results]}') for pg, text in results[:3]: print(f'\\n=== PAGE {pg} ===') print(text[:2000]) " 2>&1
python3 << 'EOF' import pdfplumber pdf_path = '/home/daytona/workspace/attachments/b0037aea-213e-4617-803c-56917302248c/Sharma mohan latest_compressed-compressed (1).pdf' results = [] try: with pdfplumber.open(pdf_path) as pdf: total = len(pdf.pages) print(f"Total pages: {total}") for i in range(total): try: text = pdf.pages[i].extract_text() if text and 'miliar' in text.lower(): results.append((i+1, text)) except: pass print(f"Miliary pages found: {[r[0] for r in results]}") for pg, text in results: print(f"\n=== PAGE {pg} ===") print(text[:3000]) except Exception as e: print(f"Error: {e}") EOF
python3 << 'EOF' import subprocess import sys pdf_path = '/home/daytona/workspace/attachments/b0037aea-213e-4617-803c-56917302248c/Sharma mohan latest_compressed-compressed (1).pdf' # Use pdftotext utility (lighter) result = subprocess.run(['pdftotext', '-f', '1', '-l', '5', pdf_path, '-'], capture_output=True, text=True, timeout=30) if result.returncode == 0: print("First 5 pages:") print(result.stdout[:2000]) else: print(f"Error: {result.stderr}") # Try alternate approach result2 = subprocess.run(['which', 'pdftotext'], capture_output=True, text=True) print(f"pdftotext location: {result2.stdout}") EOF
python3 << 'EOF' import subprocess pdf_path = '/home/daytona/workspace/attachments/b0037aea-213e-4617-803c-56917302248c/Sharma mohan latest_compressed-compressed (1).pdf' # First, search the entire text for miliary page references result = subprocess.run(['pdftotext', pdf_path, '/tmp/tb_full.txt'], capture_output=True, text=True, timeout=120) print(f"Return code: {result.returncode}") print(f"Stderr: {result.stderr[:200] if result.stderr else 'None'}") EOF
grep -i "miliar" /tmp/tb_full.txt | head -50