# How to query to CSV without annotation headers?

**URL:** <https://community.influxdata.com/t/how-to-query-to-csv-without-annotation-headers/23314>\
**Category:** Fluxlang\
**Tags:** flux\
**Created:** [January 11, 2022, 9:38am UTC](https://community.influxdata.com/t/how-to-query-to-csv-without-annotation-headers/23314 "2022-01-11T09:38:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AjejeBraso](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@AjejeBraso](https://community.influxdata.com/u/AjejeBraso)\
**Post date:** [January 11, 2022, 9:38am UTC](https://community.influxdata.com/t/how-to-query-to-csv-without-annotation-headers/23314/1 "2022-01-11T09:38:35Z")

</div>

Hello, i am trying to use the command line “influx query” command to append data to a CSV file and would like to hide the annotation headers. I can’t figure out how to hide the header annotation, is that possible with query?

my query looks something like this:

influx query 'from(bucket:“mybucket”) |\> range(start:-1m, stop: now()) |\> drop(columns: ["\_start", “\_stop”, “\_measurement”, “host”]) |\> pivot(rowKey: ["\_time"], columnKey: ["\_field"], valueColumn: “\_value”) ’ --raw -o xxxxx.xx -t “securitytoken==” \>\> output.csv

thanks in advance!

A

---

<div class="post-metadata">

**Author:** ![MWinther](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MWinther](https://community.influxdata.com/u/MWinther)\
**Post date:** [January 11, 2022, 4:31pm UTC](https://community.influxdata.com/t/how-to-query-to-csv-without-annotation-headers/23314/2 "2022-01-11T16:31:28Z")

</div>

Not necessarily a flux solution, but using grep you can easily filter out the offending lines:

`influx query --raw 'from(bucket:"system") |> range(start:-1m)' | grep -Ev '^(\s+|#.*|,result.*)?$' >> output.csv`

Where the grep filters out any empty line, line with just spaces, lines that start with ‘#’ and lines that start with ‘,result’.

---

<div class="post-metadata">

**Author:** ![AjejeBraso](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@AjejeBraso](https://community.influxdata.com/u/AjejeBraso)\
**Post date:** [January 11, 2022, 5:03pm UTC](https://community.influxdata.com/t/how-to-query-to-csv-without-annotation-headers/23314/3 "2022-01-11T17:03:35Z")

</div>

that’s great, thanks for this … i’ll give it a go, should be good enough for what i need.  
cheers!
