从 Google 云函数中的 CSV 中删除 header
remove header from a CSV in Google Cloud Funciton
我正在从 Google Cloud Big Query Table
创建一个 CSV
文件。
由于我将整个 table 转换为 CSV,默认情况下 table header
名称包含在 CSV 文件中。
这是我用来创建 CSV file
的代码
// Export data from the table into a Google Cloud Storage file
const [job] = await bigquery
.dataset(datasetId)
.table(tableId)
.extract(storage.bucket(bucketName).file(filename), options);
console.log(`Job ${job.id} created.`);
我试过用下面的代码来删除header,没用吗
const parser = csv({ headers : true });
知道如何从 CSV 中删除 header 吗??
有个printHeader
option in the API definition. In the NodeJS client library, you can find the definition in the IJobConfigurationExtract
因此,在 options
对象中使用 printHeader:false
我正在从 Google Cloud Big Query Table
创建一个 CSV
文件。
由于我将整个 table 转换为 CSV,默认情况下 table header
名称包含在 CSV 文件中。
这是我用来创建 CSV file
// Export data from the table into a Google Cloud Storage file
const [job] = await bigquery
.dataset(datasetId)
.table(tableId)
.extract(storage.bucket(bucketName).file(filename), options);
console.log(`Job ${job.id} created.`);
我试过用下面的代码来删除header,没用吗
const parser = csv({ headers : true });
知道如何从 CSV 中删除 header 吗??
有个printHeader
option in the API definition. In the NodeJS client library, you can find the definition in the IJobConfigurationExtract
因此,在 options
对象中使用 printHeader:false