Ana içeriğe geç

Şu satırları çıkar: Excel

PDF4me Satırları Çıkar bir REST Çalışma sayfası satırlarını okuyan uç nokta Excel çalışma kitabına ekler ve bunları yapılandırılmış şekilde geri gönderir. JSON. POST .xlsx dosyasını şu şekilde Base64 ile office/ApiV2Excel/ExcelExtractRowsEylem nesnesinde çalışma sayfasını ve satır aralığını kapsam içine alın ve kullanın. rowData Dizi. Dosya değil, veri döndürür: document Sonuç boş değer olarak geri döner.

Bu uç noktanın işlevi

Çalışma sayfasının bir bölümünü şuna dönüştürür: JSON Dizi: Her satır bir nesne haline gelir. satırVerisiVeritabanına eklemeye hazır, bir API Bu, bir çağrı veya bir rapordur. Satır Ekle ve Satır Güncelle işlevlerinin salt okunur karşılığıdır ve API-ihracatın eşdeğeri Excel verileri açmadan ExcelDeğiştirilmiş bir dosya oluşturulmaz.

İlgili Blog Yazıları
Bu özellik için henüz bir blog yazısı yok — yakında yayınlanacak.
Bu arada, her platforma yönelik eğitimler ve iş akışları için PDF4me bloguna göz atın.
Blogu ziyaret edin

Kimliğinizi Doğrulama API Rica etmek

Her PDF4me REST Çağrınızda mutlaka sizin de bulunmanız gerekiyor. API anahtara Authorization Başlıkta Temel kimlik doğrulama (Basic auth) belirtilmiştir. Anahtarınızı geliştirici kontrol panelinden alın veya değiştirin.

Uç nokta

POSTofis/ApiV2Excel/ExcelExtractRows

Kaçırmamanız Gereken Önemli Bilgiler

rowData çıktıdır, dosya alanları boştur.
Bu uç nokta, değiştirilmiş bir çalışma kitabı değil, veri döndürür. belge Ve fileName Tasarım gereği null değer döndürür; bir değer bekleyen kod. Base64 Dosya orada bozulacak.
Motor, satırları 0'dan başlayarak sayar.
0. satır Excel 1. satır ve -1, son veri satırına işaret eder, aynı anlama gelir. n8n Bu motor için Satırları Çıkarma eylem belgeleri. Tek farkla sonuçlanan aralıklar en çok destek isteyen sorudur.
Salt okunur: çalışma kitabınıza dokunulmamış halde kalır.
Çıkarma işlemi dosyayı ayrıştırır ve satırları serileştirir. JSONHiçbir şey geri yazılmadığı için üretim çalışma kitapları ve arşivler üzerinde güvenle çalıştırılabilir.

HTTP kurmak

Yöntem: POST
URL: https://api.pdf4me.com/office/ApiV2Excel/ExcelExtractRows
İçerik Türü: uygulama/json
Authorization: Temel <sizin PDF4me API anahtar>

Yanıt şudur: JSON: kontrol edin success bayrağı işaretle, sonra üzerinde yinele satırVerisi Dizi. Çözülecek dosya yok.

Satır Çıkarma işlemi diğerlerinden nasıl farklıdır? Excel Satır işlemleri?

Satır ailesi yazma, üzerine yazma ve okuma işlemlerini kapsar. Çalışma kitabına ne yapılacağına göre seçim yapın.

Eylem ve davranışÇalışma kitabına ne yapar?Ne karşılığında alırsınız?
Satırları Çıkar (bu uç nokta)Hiçbir şey, salt okunurA rowData JSON dizi, her satırda bir nesne
Satır EkleYeni satırlar ekler veya mevcut satırlara yenilerini ekler.Değiştirilmiş çalışma kitabı şu şekildedir: Base64
Satırları GüncelleMevcut satırlardaki değerlerin üzerine yazar.Değiştirilmiş çalışma kitabı şu şekildedir: Base64
Satırları SilSatırları siler.Değiştirilmiş çalışma kitabı şu şekildedir: Base64

API vücut alanları

ParametreGerekliTipNe işe yarar?Örnek
documentRequiredobjectDocument reference carrying Name, the Excel filename with its extension.{ "Name": "data.xlsx" }
docContentRequiredstringBase64-encoded bytes of the workbook to read.UEsDBBQABgAIAAAA...
extractRowsToExcelActionRequiredobjectAction configuration object. An empty object is valid and reads the default worksheet.{}
worksheetNameOptionalstringInside the action object. Target worksheet by name. Names are matched exactly, so a typo silently misses the sheet.Sheet1
worksheetIndexOptionalnumberInside the action object. Target worksheet by position. The extraction engine counts 0-based, so 0 is the first sheet.0
fromRow / toRowOptionalnumberInside the action object. Row range to extract. The engine counts rows 0-based with -1 meaning to the last data row, per the shared engine documented on the n8n Extract Rows action.0, -1
cultureNameOptionalstringInside the action object. Culture used when serializing dates and numbers, for example en-US or de-DE.en-US

Örnek yükler

Varsayılan çalışma sayfasını okuyun.

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"extractRowsToExcelAction": {}
}

Kültüre duyarlı değerler içeren isimli bir çalışma sayfasını okuyun.

{
"document": { "Name": "sales.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"extractRowsToExcelAction": {
"worksheetName": "Q3",
"cultureName": "en-US"
}
}

Postacı tahsilat ipuçları

Headers
Content-Type: application/json + Authorization: Basic <apiKey>.
Body
raw JSON. extractRowsToExcelAction may be an empty object {}; worksheet targeting and ranges are optional narrowing.
Response
Plain JSON. Assert on rowData, not on document: the file fields are null for this endpoint by design.
Ranges
The engine counts rows 0-based and treats -1 as "to the last data row". Test with a small explicit range first.

curl örneği

curl -X POST https://api.pdf4me.com/office/ApiV2Excel/ExcelExtractRows \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"document": { "Name": "data.xlsx" },
"docContent": "'"$(base64 -w 0 data.xlsx)"'",
"extractRowsToExcelAction": { "worksheetName": "Sheet1" }
}' \
--output response.json

Ne anlama geliyor? API geri dönmek?

A JSON yükü olan sonuç rowData sıralamak.

AlanTipİçeriğinde neler var?
rowDataArray of objectsThe primary output. Each entry is one extracted row as a JSON object, with column names or indexes as keys.
successBooleantrue when extraction succeeded. Check this before iterating rowData.
documentnullNull for this endpoint: no modified file is produced. Present only because the office family shares one response shape.
fileNamenullNull for this endpoint, for the same reason as document.
errorMessageStringPopulated when success is false: a missing worksheet, invalid Base64, or a corrupted workbook.
{
"document": null,
"fileName": null,
"success": true,
"errorMessage": null,
"rowData": [
{ "ColumnA": "value1", "ColumnB": "value2" },
{ "ColumnA": "value3", "ColumnB": "value4" }
]
}

Kod örnekleri

Excel Ofis uç noktaları henüz kişi başı fiyatlandırma kapsamına alınmamıştır.language Örnek klasörler; örnekler deposu, her birinin kullandığı istek kalıbını içerir. PDF4me uç nokta ailesi:

SSS

Why are document and fileName null in the response?+
Because Extract Rows returns data, not a modified workbook. The primary output is the rowData array of row objects; the file-oriented fields exist in the shared response shape but stay null for this endpoint.
Are row indexes 0-based or 1-based?+
The extraction engine behind this action counts rows and columns 0-based, so row 0 is Excel row 1, and -1 means read to the last data row or column. If your range seems off by one, this is why.
Can I pipe the output into a database or another API?+
Yes, that is the point of the endpoint. rowData is plain JSON: each array entry is one row as an object, ready for an INSERT statement, an HTTP POST, or any downstream transformation.
What happens if I send an empty action object?+
The action still runs: the API reads the default worksheet and returns its rows. Add worksheetName or a row range only when you need to narrow the extraction.
Does this endpoint modify my Excel file?+
No. It is read-only. The source workbook is parsed, the rows are serialized to JSON, and no modified file is produced or returned.
Can I read a password-protected workbook?+
No. Protection blocks parsing. Chain the Unlock Excel action first with the correct password, then extract from the unlocked copy.
How do I extract whole worksheets instead of rows?+
Use the Extract Worksheets action, which splits worksheets out of the workbook. Extract Rows is for reading row values as JSON; Extract Worksheets is for separating sheets as workbook content.

Neden çıkarım yapmalıyız? Excel hediye edildi API manuel olarak yapmak yerine mi?

Manuel yöntem, çalışma kitabını açmak, aralığı seçmek, bir yere kopyalamak ve her dosya için, her yenilemede bir kez elle yeniden şekillendirmektir. API Tek bir deterministik istekle aynı satırları okur ve size teslim eder. JSON herhangi bir language yerel olarak ayrıştırır, hiçbir şey içermez. Excel Sunucuya kurulum. Çünkü kaynak standart kalıyor. Ofis Açık XML Çalışma kitabı ve işlem salt okunur ise, aynı çağrı canlı dosyalara karşı planlı olarak güvenle çalıştırılabilir.

İlgili işlemler

Diğer platformlarda aynı görev

Yardım Alın