بازیابی اسناد و صفحات گسترده ذخیره نشده، بازنویسی شده یا خراب¶
شماره های اضطراری بر اساس کشور متفاوت است. این صفحه از 911 استفاده میکند که شماره مربوط به ایالات متحده و کانادا است. بسیاری از کشورهای دیگر از 112، 999 یا شماره دیگری استفاده می کنند. شماره کشور خود را پیدا کنید.
بستن یک قرارداد 40 صفحهای مایکروسافت ورد یا یک مدل مالی پیچیده اکسل با کلیک تصادفی روی «ذخیره نشود»، تماشای خرابی رایانه شما قبل از ضربه زدن Ctrl + S، به طور تصادفی یک الگوی خالی را در فایل اصلی سال گذشته ذخیره کنید یا پیام وحشتناک "Word در تلاش برای باز کردن فایل با خطا مواجه شد" چند دقیقه قبل از یک مهلت فاجعه بار دریافت کرد. از آنجا که برنامههای بهرهوری مدرن ویرایشهای فعال را در بافرهای رم فرار و فهرستهای راهاندازی موقت پنهان نگه میدارند (AutoRecover .asd، .wbk، .tmp، و UnsavedFiles، انجام حرکت اشتباه در 60 ثانیه اول می تواند باعث شود که برنامه آن فایل های مرحله بندی را برای همیشه پاک کند.
حتی زمانی که الف .docx، .xlsx، .pptx، یا .odt فایل واقعاً روی دیسک خراب شده است، شماره متن و صفحه گسترده شما تقریباً هرگز از بین نمی رود. XML Open Office مدرن (.docx، .xlsx، .pptx) و OpenDocument (.odt، .ods) فایل ها در واقع استاندارد هستند .zip ظروف بایگانی حاوی فایل های XML متن ساده (word/document.xml یا xl/worksheets/sheet1.xml). حتی اگر دایرکتوری مرکزی بیرونی ZIP به دلیل قطع برق یا کشش درایو فلش USB کوتاه شده باشد، میتوانید 99 درصد نثر و فرمولهای خود را مستقیماً در کمتر از پنج دقیقه از جریان XML خام خارج کنید.
همین الان این کار را بکن¶
- نوشتن فایلهای جدید، نصب برنامههای بازیابی یا راهاندازی مجدد رایانه را متوقف کنید. اگر برنامهای از کار افتاد یا روی «ذخیره نشود» کلیک کردید، فایل مرحلهبندی موقت (
.asd،.tmp، یا-$فایل قفل) در سیستم عامل شما قرار داردAppDataیا/tmpدایرکتوری همین الان در درایوهای حالت جامد (SSD) باTRIMفعال شود، ذخیره فایلهای بزرگ یا نصب ابزارهای «تعمیر اسناد» bloatware روی همان درایو، بلوکهای فلش تخصیصنخوردهای را که بافرهای موقتی حذف شده شما را نگه میدارند، برای همیشه صفر میکند. - اگر فقط یک متن مهم را در یک سند STILL-OPEN بازنویسی کرده و ضربه بزنید
Ctrl + S(ذخیره)، پنجره را نبندید، فشار دهیدCtrl + Z(Command + Zدر Mac) به طور مکرر. در Microsoft Word، Excel، LibreOffice، Google Docs، و Apple Pages، کلیک کردن بر روی "ذخیره" وضعیت فعلی را روی دیسک می نویسد **اما تا زمانی که پنجره سند باز است، پشته Undo موجود در حافظه پاک نمی شود. فشار دادنCtrl + Z50 یا 100 بار از ذخیره تصادفی شما به عقب بر می گردد و پاراگراف های حذف شده را بازیابی می کند، سپس می توانید آنها را در یک فایل جدید کپی کنید. - قبل از دست زدن به فاسد
.docx،.xlsx،.pdf، یا.sqliteفایل، دوبار کپی کنید (Copy 1وCopy 2) در یک پوشه امن. هرگز "Open and Repair" را در Microsoft Word اجرا نکنید.zip -FF، یاsqlite3 .recoverمستقیماً روی تنها نسخه اصلی یک فایل آسیب دیده. همیشه روی یک نسخه تکراری کار کنید تا اگر یک ابزار تعمیر یک جدول ناخوانا را کوتاه کند، بایت های خام اصلی شما برای استخراج عمیق تر پزشکی قانونی دست نخورده باقی می مانند. - ** موارد پنهان را بررسی کنید
UnsavedFilesدایرکتوری در مایکروسافت ورد، اکسل، و پاورپوینت بلافاصله.** حتی زمانی که روی یک سند آفیس کاملاً جدید یا اصلاح شده روی "ذخیره نشود" کلیک می کنید، مایکروسافت ورد، اکسل و پاورپوینت مدرن بی سر و صدا یک کپی از بازیابی خودکار را حفظ می کنند..asdعکس فوری داخل%LOCALAPPDATA%\Microsoft\Office\UnsavedFilesبه مدت چهار روز قبل از حذف. File > Info > Manage Document > Recover Unsaved Document (یا Recover Workbooks ذخیره نشده را در Excel) باز کنید تا فوراً آن را بگیرید. - اگر به طور تصادفی روی یک فایل ذخیره شده در OneDrive، Google Drive، Dropbox، iCloud Drive یا SharePoint ذخیره کردید، آن را از طریق Web Version History در 30 ثانیه بازیابی کنید. موتورهای همگام سازی Cloud فایل ها را به طور مخرب بازنویسی نمی کنند. هر بار
Ctrl + Sبا ابر همگامسازی میشود، سرور یک عکس فوری مهر زمانی به فایل تاریخچه نسخه اضافه میکند (25 تا 500 نسخه آخر را برای 30 روز حفظ میکند). روی فایل -> تاریخچه نسخه کلیک راست کنید تا دقیقا دقیقه قبل از اشتباه بازیابی شود. - در مواقع اضطراری مدارک تحصیلی، حقوقی یا پزشکی با استرس بالا نگاه داشته باشید. هیچ صفحه گسترده یا پایان نامه گم شده ارزش یک بحران سلامت جسمی را ندارد. اگر در حال تلاش برای بازیابی دستورالعملهای مهم پزشکی یا سوابق اضطراری در طول یک تهدید ایمنی فعال هستید، ابتدا ایمنی انسان را در اولویت قرار دهید و با شماره اورژانس محلی خود تماس بگیرید (911 در ایالات متحده و کانادا، 112 در سراسر اتحادیه اروپا، 999 در بریتانیا، یا به ما مراجعه کنید. شماره های اضطراری دایرکتوری).
هرگز به «وبسایتهای تعمیر آنلاین DOCX/XLSX» پرداخت نکنید یا فایلهای حقوقی، پزشکی یا مالیاتی محرمانه را در درگاههای تعمیر ابری شخص ثالث آپلود نکنید.
دهها وبسایت غارتگر در صدر موتورهای جستجو قرار میگیرند که ادعا میکنند «تعمیر فایلهای ورد و اکسل خراب شده آنلاین» را دارند. اکثر این سایت ها به سادگی منبع باز رایگان را اجرا می کنند zip -FF یا xmllint در سرور آنها، یک پیشنمایش تار از متن خود را به شما نشان میدهند و برای دانلود فایل XML، 29 تا 49 دلار در بیتکوین یا پرداختهای کارت اعتباری درخواست میکنند، در حالی که اظهارنامههای مالیاتی محرمانه، گذرواژهها یا قراردادهای قانونی خود را روی یک سرور خارجی غیرقابل اعتماد جمعآوری میکنند. با استفاده از مراحل زیر میتوانید دقیقاً همان استخراج ZIP/XML را به صورت محلی در رایانه شخصی خود در 60 ثانیه به صورت رایگان انجام دهید.
درخت تصمیم تریاژ بازیابی سند و صفحه گسترده¶
flowchart TD
Start["سند اضطراری: فایل ذخیره نشده، بازنویسی شده یا خراب شده است"] --> Scenario{"کدام شکست به تازگی اتفاق افتاده است؟"}
Scenario -->|"1. Clicked 'Don't Save' or App Crashed Before Saving"| UnsavedPath["مرحله 1: فایل > اطلاعات > مدیریت سند > بازیابی اسناد ذخیره نشده را بررسی کنید<br/>مرحله 2: همه فایلهای .asd، .xlb، و .tmp را از AppData\Local & Roaming\Microsoft\Word/Excel<br/>مرحله 3:در Mac، پوشههای Autoderco و $TMIRvetem را بررسی کنید."]
Scenario -->|"2. Accidentally Overwrote File and Hit Save (Ctrl+S)"| OverwritePath{"Is the Document Window Still Open?"}
OverwritePath -->|"Yes: Still Open"| UndoNow["Press Ctrl+Z (Cmd+Z) repeatedly -> Copy recovered text to a new file -> Save As"]
OverwritePath -->|"No: Already Closed"| VersionPath["Step 1: Check Cloud Version History (OneDrive, Google Drive, Dropbox, iCloud)<br/>Step 2: On Windows, inspect NTFS Volume Shadow Copies ('Previous Versions' / ShadowExplorer)<br/>Step 3: On Mac, check APFS Local Snapshots, Time Machine, or 'Revert To > Browse All Versions'"]
Scenario -->|"3. File Refuses to Open ('File Corrupted / Unreadable Content')"| CorruptPath{"What Type of File Is Corrupted?"}
CorruptPath -->|"Modern Office (.docx, .xlsx, .pptx) or LibreOffice (.odt, .ods)"| ZipXML["1. Duplicate file -> Try 'Open and Repair' in Word/Excel or open in LibreOffice<br/>2. Rename copy to .zip -> Run '7z x' or 'zip -FF' -> Extract word/document.xml or xl/sharedStrings.xml"]
CorruptPath -->|"Legacy Binary Office (.doc, .xls) or PDF (.pdf)"| BinaryFix["Extract strings via 'Recover Text from Any File' OR repair PDF xref table with 'qpdf --decrypt' / 'mutool clean'"]
CorruptPath -->|"SQLite Database (.sqlite, .db) or CSV"| DBFix["Run 'sqlite3 corrupt.db \".recover\"| sqlite3 fixed.db' to rebuild B-tree pages"]
Scenario 1: Recovering UNSAVED documents (After clicking "Don't Save" or an App Crash)¶
When you work in Microsoft Word, Excel, PowerPoint, LibreOffice, or Adobe apps, the program writes periodic AutoRecover snapshots (defaulting to every 10 minutes) and temporary swap buffers (-WRDxxxx.tmp) to hidden system folders.
Exact hidden file paths for Unsaved & AutoRecover files across Windows, macOS, and Linux¶
Open a File Explorer, Finder (Cmd + Shift + G), or Terminal window and check these exact directories immediately before opening and closing the application multiple times:
| Application & OS | Exact Directory Path Containing Unsaved .asd، .tmp, and AutoRecover Files |
File Extensions to Look For |
|---|---|---|
| Microsoft Word, Excel & PowerPoint (Windows) | 1. %LOCALAPPDATA%\Microsoft\Office\UnsavedFiles (فایل هایی که روی "ذخیره نشود" کلیک کرده اید)2. %APPDATA%\Microsoft\Word\ (or \Excel\ / \PowerPoint\)3. %LOCALAPPDATA%\Temp\ |
.asd (AutoRecover Snapshot), .wbk (Word Backup), .xlb / .xar (Excel AutoRecover), -WRD*.tmp، -WRL*.tmp |
| Microsoft Word, Excel & PowerPoint (macOS) | 1. -/Library/Containers/com.microsoft.Word/Data/Library/Preferences/AutoRecovery (replace Word with Excel یا Powerpoint)2. Session Temp Folder: Run open $TMPDIR in Terminal and open the TemporaryItems subfolder |
AutoRecovery save of *.docx، .asd، -WRL*.tmp |
| LibreOffice Writer / Calc / Impress (Windows, macOS, Linux) | Windows: %APPDATA%\LibreOffice\4\user\backup\macOS: -/Library/Application Support/LibreOffice/4/user/backup/Linux: -/.config/libreoffice/4/user/backup/ و /tmp/lu* |
.bak، .odt_0.odt، lu*.tmp |
| Apple Pages, Numbers & Keynote (macOS) | 1. -/Library/Containers/com.apple.iWork.Pages/Data/Library/Autosave Information/2. -/Library/Application Support/CloudDocs/session/containers/ |
.pages، .numbers، .key package bundles |
| Notepad++ & VS Code (Even for Unnamed Unsaved Tabs) | Notepad++: %APPDATA%\Notepad++\backup\VS Code (Win): %APPDATA%\Code\User\History\ & %APPDATA%\Code\Backups\VS Code (Mac): -/Library/Application Support/Code/User/History/ |
new 1@2026-..., timestamped JSON/text history snapshots |
One-command PowerShell & macOS/Linux script to harvest all Office temp files right now¶
Instead of clicking through ten hidden folders manually, run this read-only rescue script to copy every surviving .asd، .wbk, and Office .tmp file modified in the last 48 hours into a folder on your Desktop:
- On Windows (Run in PowerShell):
$RescueDir = "$env:USERPROFILE\Desktop\Document_Rescue" New-Item -ItemType Directory -Force -Path $RescueDir | Out-Null $SearchPaths = @( "$env:LOCALAPPDATA\Microsoft\Office\UnsavedFiles", "$env:APPDATA\Microsoft\Word", "$env:APPDATA\Microsoft\Excel", "$env:APPDATA\Microsoft\PowerPoint", "$env:LOCALAPPDATA\Temp" ) Get-ChildItem -Path $SearchPaths -Include "*.asd","*.wbk","*.xar","~WRD*.tmp","~WRL*.tmp","*.docx","*.xlsx" -Recurse -Force -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -gt (Get-Date).AddHours(-48) } | ForEach-Object { Copy-Item $_.FullName -Destination (Join-Path $RescueDir ($_.LastWriteTime.ToString("HHmmss_") + $_.Name)) -Force } Write-Host "Copied all candidate recovery files to $RescueDir" - On macOS / Linux (Run in Terminal):
mkdir -p ~/Desktop/Document_Rescue find ~/Library/Containers/com.microsoft.* "$TMPDIR" ~/.config/libreoffice /tmp \ \( -iname "*.asd" -o -iname "*AutoRecovery*" -o -iname "~WR*.tmp" -o -iname "*.bak" \) \ -mtime -2 -exec cp -p {} ~/Desktop/Document_Rescue/ \; 2>/dev/null ls -la ~/Desktop/Document_Rescue/ - How to open a recovered
.asdیا-WRLxxxx.tmpfile: Do not double-click an.asdfile in File Explorer (Windows often claims it cannot open.asddirectly). Instead, launch Microsoft Word -> click File > Open > Browse -> change the file-type dropdown in the bottom-right corner to "All Files (*.*)" -> select the.asdیا.tmpfile inside yourDocument_Rescuefolder.
Scenario 2: Recovering OVERWRITTEN files (When you saved over a good file and closed the app)¶
If you accidentally opened last month's master spreadsheet, deleted half the tabs, hit Ctrl + S (ذخیره) به جای Save As، و قبلاً برنامه را بسته بود، بافر Undo در حافظه از بین رفته است. با این حال، سیستم های فایل مدرن و کلاینت های همگام سازی، بلوک های تاریخی را از طریق پنج مکانیسم حفظ می کنند:
1. Cloud Sync Version History (OneDrive, SharePoint, Google Drive, Dropbox, iCloud)¶
اگر فایل در داخل شما زندگی می کرد Desktop، Documents, or cloud folder synced by OneDrive, Dropbox, Google Drive, or iCloud:
- Microsoft OneDrive / SharePoint: Right-click the file in File Explorer (or log into onedrive.live.com) -> click Version history. Click the three dots (...) next to the timestamp from before your mistake and click Restore.
- Google Drive (even for native .docx / .xlsx files synced via Drive for Desktop): Right-click the file in drive.google.com -> File information > Manage versions, or open the document and press Ctrl + Alt + Shift + H to view full revision history.
- Dropbox: Right-click the file -> Version history (retains every save for 30 to 180 days; even if you overwrote 100 files at once, Dropbox Rewind rolls the entire folder back to any minute).
- Apple iCloud Drive & macOS Native Versioning (NSDocument Versions): On macOS, open the overwritten file in Pages, Numbers, Keynote, TextEdit, or Preview and click File > Revert To > Browse All Versions... from the top menu bar. macOS maintains an internal SQLite/chunked document version database (/.DocumentRevisions-V100) on your APFS drive even if you do not use Time Machine.
2. Windows NTFS Volume Shadow Copies (Previous Versions و ShadowExplorer)¶
Even on a local C: drive that is not synced to any cloud, Windows periodically creates read-only point-in-time block snapshots of your drive called Volume Shadow Copies (VSS) during system restore points or updates:
1. Right-click the overwritten file (or the parent folder holding it) in File Explorer -> click Properties -> Previous Versions tab.
2. If the Previous Versions tab appears empty, do NOT stop there: Windows 10 and 11 frequently hide existing VSS snapshots in the File Explorer GUI while the shadow volumes are still sitting intact on disk.
3. Open an Administrator Command Prompt and check if shadow copies exist:
vssadmin list shadows lists one or more HARDDISKVOLUME_SHADOWCopy volumes (for example, \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3), link that snapshot directly to a folder on your C: drive so you can browse it and copy out your pre-overwritten document:
Open C:\ShadowRescue\Users\YourName\Documents\ in File Explorer and copy out the intact older version of your file.
3. macOS APFS Local Snapshots (tmutil listlocalsnapshots)¶
Even when your external Time Machine backup drive has been unplugged in a closet for two weeks, macOS automatically creates hourly APFS Local Snapshots directly on your internal Mac SSD:
# List all hidden local APFS snapshots stored on your internal Mac SSD
tmutil listlocalsnapshots /
# Mount a local snapshot read-only to extract the pre-overwritten file
mkdir -p /tmp/apfs_rescue
sudo mount_apfs -s com.apple.TimeMachine.2026-10-31-093000.local /System/Volumes/Data /tmp/apfs_rescue
cp "/tmp/apfs_rescue/Users/$USER/Documents/MyContract.docx" ~/Desktop/MyContract_Recovered.docx
Scenario 3: Repairing CORRUPTED .docx، .xlsx، .pptx، و .odt files (The ZIP + XML Surgical Extraction Method)¶
Why do modern Office documents corrupt? Starting with Microsoft Office 2007, .docx، .xlsx، و .pptx files (as well as LibreOffice .odt، .ods، و .odp files) are not single monolithic binary files. Every .docx یا .xlsx file is actually a standard PKZIP archive containing a tree of folders and UTF-8 XML files.
When a USB flash drive is unplugged without ejecting, a network share drops during a save, or Word crashes mid-write, the ZIP Central Directory Header at the very end of the file gets truncated, or a single XML tag in word/document.xml fails to close. Microsoft Word and Excel have very strict XML parsers: if even one byte in the ZIP footer or XML schema is malformed, Word refuses to open the entire 50-page document.
Step 1: Try the 3 built-in non-destructive parser overrides first¶
Always duplicate your corrupted file (Contract_Copy.docx) before testing these three quick fixes:
- Microsoft Office Built-In "Open and Repair":
- Launch Word, Excel, or PowerPoint -> click File > Open > Browse (do not click the file from the "Recent Files" list).
- Click once on your corrupted duplicate file to highlight it.
- Click the tiny down-arrow (
▼) on the right edge of the[ Open | ▼ ]button at the bottom-right of the dialog box, and select "Open and Repair...". - In Excel, if Repair fails, repeat the step and choose "Extract Data" -> "Convert to Values" or "Recover Formulas".
- Open the Corrupted
.docx/.xlsxinside LibreOffice or Google Docs: - LibreOffice Writer and Calc (free, open-source at
libreoffice.org) use a much more forgiving, fault-tolerant XML and ZIP parser than Microsoft Office. In roughly 60 percent of cases where Microsoft Word or Excel completely refuses to open a corrupted file, opening that exact same.docxیا.xlsxfile inside LibreOffice opens the entire document cleanly and lets you click File > Save As to write out a brand-new, specification-compliant.docxیا.xlsxfile. - In Excel: Reference the Broken Workbook Cells from a New Blank Workbook (External Link Extraction):
- If a corrupted
.xlsxیا.xlsworkbook crashes Excel every time you try to open it, you can pull the raw cell values out without ever opening the corrupt file: - Open a brand-new blank Excel workbook.
- In cell
A1, type an external formula referencingSheet1of your corrupted file: - را فشار دهید
Enter. اکسل جریان سلول خام BIFF/XML را از دیسک بدون رندر کردن نمودارها، ماکروها یا استایل های خراب می خواند. دستگیره پر را روی ستون ها بکشیدAاز طریقZو 1000 سطر را پایین بیاورید تا تک تک شماره ها و رشته های متن را در برگه بیرون بیاورید، سپس همه سلول ها را کپی کنید و مقادیر چسباندن (Ctrl + Alt + V -> Values).
مرحله 2: روش استخراج ZIP + XML (99٪ متن/اعداد را در صورت عدم موفقیت "Open and Repair" بازیابی می کند)¶
اگر هم Office "Open and Repair" و هم LibreOffice با شکست مواجه شوند زیرا .docx، .xlsx، .pptx، یا .odt ظرف ZIP کوتاه شده است، فایل های XML داخلی را مستقیماً استخراج کنید:
آناتومی یک Office Open XML (.docx / .xlsx / .pptx) آرشیو¶
| نوع فایل بیرونی | تغییر نام پسوند به | فایل XML داخلی که کار واقعی شما را نگه می دارد | چه چیز دیگری در بایگانی زندگی می کند |
|---|---|---|---|
** سند ورد (.docx)** |
.zip |
word/document.xml (100% متن اصلی)word/header1.xml، word/footer1.xml، word/footnotes.xml |
word/media/ (هر عکس جاسازی شده، PNG و JPEG با وضوح 100٪ اصلی) |
کتاب کار اکسل (.xlsx) |
.zip |
xl/sharedStrings.xml (همه رشته های متن در کتاب کار)xl/worksheets/sheet1.xml، sheet2.xml (همه مقادیر عددی، مختصات سلول و فرمول ها) |
xl/media/ (تصاویر تعبیه شده)xl/calcChain.xml (اغلب فایلی که خراب می شود، حذف می شود calcChain.xml بسیاری از خرابی ها را رفع می کند .xlsx فایل ها) |
عرشه پاورپوینت (.pptx) |
.zip |
ppt/slides/slide1.xml، slide2.xmlو غیرهppt/notesSlides/notesSlide1.xml (Speaker notes) |
ppt/media/ (همه تصاویر اسلاید، صدا و کلیپ های ویدئویی) |
LibreOffice (.odt / .ods) |
.zip |
content.xml (همه متن سند، جداول و سلول های صفحه گسترده) |
Pictures/ (همه گرافیک های تعبیه شده) |
Exact terminal / PowerShell commands to rebuild the ZIP archive and extract raw prose¶
- از فایل خراب کپی کنید و پسوند آن را به آن تغییر نام دهید
.zip(مثلاًBrokenThesis.docx->BrokenThesis.zip). - Force-extract the surviving XML and Media files ignoring ZIP header corruption:
- استفاده از 7-Zip (ویندوز / لینوکس / macOS) یا
zip -FF(macOS / Linux): اگر پاورقی ZIP آسیب دیده باشد، استخراج ZIP استاندارد Windows Explorer متوقف می شود، در حالی که 7-Zip (7z x) و Info-ZIP (zip -FF) scan sector-by-sector from the start of the file and extract every intact file before the truncation point:# On macOS or Linux: Rebuild the damaged ZIP structure and extract everything zip -FF BrokenThesis.zip --out RepairedArchive.zip unzip -q RepairedArchive.zip -d Extracted_Contents/ # Or using 7-Zip (extracts word/document.xml even if the end of the file is missing): 7z x BrokenThesis.zip -oExtracted_Contents/ - Quick-Fix for Excel
.xlsxFiles (calcChain.xml&styles.xmlحذف): - Over half of corrupted Excel
.xlsxfiles fail to open only becausexl/calcChain.xmlیاxl/styles.xmlis corrupted, whilexl/worksheets/sheet1.xmlوxl/sharedStrings.xmlare 100 percent intact. - Inside
Extracted_Contents/xl/, deletecalcChain.xml, re-zip the contents ofExtracted_Contentsback intoFixedWorkbook.xlsx, and open it in Excel (Excel automatically rebuildscalcChain.xmlon boot). - Extract clean, human-readable paragraphs from a truncated
word/document.xml(یاcontent.xml): - Even if
word/document.xmlwas cut off halfway through by a power outage, it is a plain UTF-8 text file where every paragraph is wrapped in<w:p>tags and every text run is inside<w:t>Your text here</w:t>. - Run this one-line Python command (works on Windows, macOS, and Linux without installing anything) to strip all XML markup and dump your clean paragraphs into
Recovered_Prose.txt:python3 -c " import re, html, pathlib raw = pathlib.Path('Extracted_Contents/word/document.xml').read_text(encoding='utf-8', errors='ignore') raw = re.sub(r'</w:p>', '\n\n', raw) text = html.unescape(re.sub(r'<[^>]+>', '', raw)) pathlib.Path('Recovered_Prose.txt').write_text(text, encoding='utf-8') print('Saved clean text to Recovered_Prose.txt') " - On Windows PowerShell (if Python is not installed):
Scenario 4: Recovering corrupted PDFs, legacy .doc/.xls files, and SQLite databases¶
1. Repairing Corrupted PDF Files (Damaged xref table / Failed to load PDF document)¶
A PDF file stores its page objects from the top of the file downward, and places a Cross-Reference Table (xref) و %%EOF trailer at the very bottom of the file telling the PDF reader the exact byte offset of each page. If an email attachment download or scanner transfer stops at 98 percent, the xref footer is missing and Adobe Acrobat refuses to open the file, even though 98 percent of the pages are sitting right inside the file.
- Rebuild the PDF xref table automatically using qpdf، mutool (MuPDF), or Ghostscript (gs):
# Method 1: qpdf (scans raw PDF objects and generates a brand-new xref table)
qpdf --ier-warnings BrokenFile.pdf RepairedFile.pdf
# Method 2: MuPDF mutool clean (salvages damaged PDF streams and fonts)
mutool clean -gggg BrokenFile.pdf RepairedFile.pdf
# Method 3: Ghostscript (re-renders surviving pages into a fresh PDF)
gs -o RepairedFile.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress BrokenFile.pdf
2. Legacy Binary .doc و .xls Files (Office 97 to 2003 OLE2 Compound Documents)¶
Older .doc و .xls files are not ZIP archives; they use Microsoft's binary OLE2 Compound File Binary Format. To pull text out of a corrupted .doc file:
- In Microsoft Word, go to File > Open > Browse, change the file-type dropdown next to the filename box from All Word Documents to Recover Text from Any File (*.*), and open the .doc file.
- Or on macOS/Linux, run antiword Broken.doc > rescued.txt یا strings -n 6 Broken.doc > rescued.txt.
3. Repairing Corrupted SQLite Databases (.sqlite، .db, Browser History, Accounting Apps, Apple Notes, Quicken, Zotero)¶
Hundreds of desktop and mobile applications store your data inside an SQLite 3 database file (.sqlite، .db، .sqlite3). When a computer loses power mid-transaction and you get Runtime error: database disk image is malformed (11):
1. First: Keep the -wal (Write-Ahead Log) و -shm فایل ها دقیقاً در همان پوشه ای هستند که .sqlite هنگام تهیه نسخه پشتیبان خود، فایل را ثبت کنید. اغلب، آخرین کار ذخیره نشده شما در داخل آن قرار دارد database.sqlite-wal در انتظار بازرسی
2. ** SQLite داخلی را اجرا کنید .recover engine** (معرفی شده در SQLite 3.29+، که صفحات دیسک B-tree خام 4KB را اسکن می کند، حتی زمانی که جدول طرح اصلی آسیب دیده است و یک پایگاه داده تمیز را بازسازی می کند):
sqlite3، اجرا کنید sqlite3 corrupted.db ".dump" | sqlite3 repaired.db).
4. بازیابی اسناد ذخیره نشده گوگل، صفحات گوگل و متن فرم مرورگر وب (IndexedDB کش & RAM)¶
اگر در حال تایپ کردن یک گزارش طولانی در داخل Google Docs، Notion، Confluence یا یک کادر متنی مرورگر وب در حالت آفلاین (یا زمانی که یک برگه قبل از همگامسازی با ابر مسدود میشود) چه میشود؟
- Google Docs / Sheets فضای آفلاین محلی (IndexedDB(%LOCALAPPDATA%\Google\Chrome\User Data\Default\IndexedDB\https_docs.google.com_0.indexeddb.leveldb). دادههای مرور مرورگر را پاک نکنید یا از سیستم Chrome خارج نشوید. دوباره به Wi-Fi متصل شوید و برگه ثابت را به مدت 2 دقیقه باز بگذارید تا Service Worker پسزمینه بتواند صف LevelDB را در سرورهای Google پاک کند یا متن را مستقیماً از روی صفحه کپی کند با استفاده از Ctrl + A -> Ctrl + C (یا با استفاده از عنصر DOM را بررسی کنید F12 Developer Tools -> تب Elements -> روی آن راست کلیک کنید <div class="kix-page"> گره -> کپی > عنصر کپی).
- بازیابی متن گم شده در برگه مرورگر بسته یا تازه شده: اگر به طور تصادفی یک فرم وب (مانند درخواست کمک هزینه، بلیط پشتیبانی یا فرم دریافت پزشکی) را پس از یک ساعت تایپ بسته یا بازخوانی کردید، ** را فشار دهیدCtrl + Shift + T (Command + Shift + T در Mac) بلافاصله برگه بسته شده را دوباره باز کنید، سپس ** را فشار دهیدCtrl + Z** داخل کادر متنی، یا قبل از بستن فرآیند مرورگر، فضای خالی حافظه مرورگر را بررسی کنید.
پیشگیری: ذخیره خودکار سند ضد گلوله را پیکربندی کنید تا دیگر هرگز کار خود را از دست ندهید¶
امروز سه دقیقه را صرف تغییر این چهار تنظیمات در برنامه های بهره وری خود کنید:
- فاصله بازیابی خودکار مایکروسافت آفیس را از 10 دقیقه به 2 دقیقه کاهش دهید: در ورد، اکسل و پاورپوینت، File > Options > Save را باز کنید، "ذخیره اطلاعات بازیابی خودکار را هر [ 2] دقیقه" تغییر دهید و بررسی کنید "آخرین نسخه بازیابی خودکار را اگر بدون ذخیره کردن ببندم حفظ شود" علامت زده شده است.
- «همیشه یک نسخه پشتیبان ایجاد شود» را در Microsoft Word فعال کنید: به مسیر File > Options > Advanced > Save بروید و «همیشه نسخه پشتیبان ایجاد شود» را علامت بزنید. هر بار که زدی
Ctrl + SدرReport.docx، Word به طور خودکار نسخه قبلی را ذخیره می کندBackup of Report.wbkدر همان پوشه - روشن کردن کپی های پشتیبان خودکار LibreOffice: Tools > Options > Load/Save > General را باز کنید و "همیشه یک نسخه پشتیبان ایجاد کنید" و "Save AutoRecovery information هر 5 دقیقه" را علامت بزنید.
- هرگز اسناد مهم را مستقیماً روی یک فلش USB قابل جابجایی ارزان ویرایش نکنید: همیشه فایل را در SSD داخلی خود کپی کنید (
Documentsپوشه ای که توسط a استراتژی پشتیبان 3-2-1)، کار خود را به صورت محلی انجام دهید، و فایل تمام شده را تنها پس از بستن برنامه و کلیک روی "Safely Remove Hardware / Eject" در درایو USB thumb درایو کپی کنید.
سوالات متداول¶
I worked on a Word document for five hours that I opened directly from an Outlook or Gmail attachment, clicked "Save", closed it, and now my changes are nowhere to be found. Where did my file go?
When you double-click an attachment inside desktop Microsoft Outlook or a web browser without clicking "Save As" to your Documents folder first, your computer saves the attachment into a hidden, randomized temporary cache folder (`%LOCALAPPDATA%\Microsoft\Windows\INetCache\Content.Outlook\` on Windows, or `~/Library/Containers/com.microsoft.Outlook/Data/Library/Caches/` on macOS). When you hit `Ctrl + S`, Word saves your five hours of edits into that hidden `Content.Outlook` sub-folder. Open Word immediately, check **File > Open > Recent** (or run the PowerShell/Terminal search script in Scenario 1 above to scan `INetCache` and `Temp` for all `.docx` files modified in the last 24 hours) and save a copy to your Desktop.
Why did my Word document turn into pages of squares, gibberish symbols, or `########` signs when I opened it from a USB flash drive?
Two distinct errors cause this symptom: (1) If the file shows solid pages of `########` or `NUL` (zero-byte `0x00`) characters in a hex editor (`HxD`), the operating system pre-allocated the file size on the FAT32/exFAT USB drive, **but the USB stick was unplugged before the write cache flushed the actual data blocks to flash memory**. In that case, inspect the computer where the file was written for surviving `.asd` / `.tmp` files, or run `chkdsk E: /f` on a copy of the USB drive to check `FOUND.000\FILE0000.CHK` orphan clusters. (2) If the file shows random ASCII symbols starting with the letters `PK` at the very top of page 1, your file is completely fine, you simply opened a modern `.docx` ZIP file using Word's "Recover Text from Any File" filter instead of the normal XML parser.
If I rename a corrupted `.docx` or `.xlsx` file to `.zip`, can I rescue the high-resolution photos and charts embedded inside the document?
Yes, and this is one of the fastest benefits of the Office Open XML format. Inside every `.docx`, `.xlsx`, and `.pptx` archive is a subfolder named `word/media/`, `xl/media/`, or `ppt/media/` (or `Pictures/` inside a LibreOffice `.odt` file). Unlike older binary `.doc` files that compressed images into proprietary streams, modern Office files store every inserted photograph, logo, and diagram as an individual, unencrypted `.png`, `.jpeg`, `.svg`, or `.emf` file inside that `media/` subfolder. Extracting the archive with 7-Zip recovers all embedded images at their full native resolution in seconds.
Can I use undelete software like Recuva or PhotoRec to recover an unsaved Word document that was never saved to disk even once?
Yes, provided you stop using the computer immediately. Even if you never pressed `Ctrl + S` on "Document1", Microsoft Word and LibreOffice still write temporary swap and AutoRecover files (`.asd` and `~WRDxxxx.tmp`) to your storage drive every few minutes once the document exceeds the small RAM buffer. However, if you live on a modern SSD with `TRIM` enabled and close the app properly, those deleted temp blocks may be trimmed quickly, so always copy the live `%LOCALAPPDATA%\Microsoft\Office\UnsavedFiles` directory **before** running a full-disk carver. For deleted files that were previously saved, follow our [accidental file deletion and formatted drive recovery](accidental-file-deletion-formatted-drive-and-photo-recovery.md) guide.
راهنماهای مرتبط¶
- حذف تصادفی فایل، درایو فرمت شده و بازیابی عکس
- خرابی هارد دیسک و بازیابی اطلاعات
- پشتیبان گیری کامپیوتر: استراتژی 3-2-1 و بازیابی فاجعه
- بازیابی باج افزار و بدافزار
- قفل کلید بازیابی رمزگذاری BitLocker، FileVault و LUKS
- دایرکتوری شماره های اضطراری
منابع بررسی شد¶
- بینالمللی Ecma و ISO/IEC (بینالمللی): استاندارد ECMA-376 / ISO/IEC 29500: فرمتهای فایل XML باز آفیس (کنوانسیونهای بستهبندی باز ظروف ZIP و پردازش Word/ML/SpreadsheetML مشخصات).
- OASIS (سازمان برای پیشرفت استانداردهای اطلاعات ساختاریافته): فرمت اسناد باز (ODF) نسخه 1.3 مشخصات برای برنامه های اداری (
.odt،.ods،.odpمعماری بسته XML). - Microsoft Learn مستندات رسمی: Word چگونه بازیابی خودکار را ایجاد و بازیابی می کند (
.asd) و موقت (-WRD*.tmp) فایل ها و عیب یابی اسناد آسیب دیده در Word و Excel. - SQLite Consortium Official Documentation: Database Corruption, Write-Ahead Logging (
-wal), and Using the.recoverCLI Command on Damaged B-Tree Files. - Adobe / ISO 32000-2 Specification: Portable Document Format (PDF 2.0) Cross-Reference (
xref) Table Structure and Stream Recovery.