As thatjeffsmith kindly noted, hopefully this bug is fixed in the next release. Until then, you can accomplish the desired results using SQLcl (the modern SQL*Plus included with and used by SQLDeveloper 4.1.2) in conjunction with a SED script.
SQLcl is located here: $SQLDEV_HOME\sqldeveloper\bin\sql. $SQLDEV_HOME is simply the directory of your installed SQLDeveloper version.
In your example, you are generating two separate output files, A.txt and B.txt, from a single SQL file. My following proposed method will require that this be broken up into two separate SQL files: A.sql and B.sql.
A.sql:
set echo off
set feedback off
set termout off
select /*csv*/ * from A where rownum <= 1000;
B.sql:
set echo off
set feedback off
set termout off
select /*csv*/ * from B where rownum <= 1000;
Below is the one-line contents of my SED script named "remove-first-blank-line.sed":
0,/^$/{//d}
"0," defines that the following command block will only be applied to the first line.
"/^$/" defines the regular expression pattern to match. The "^" is the start of a line and the "$" is the end of line marker, so this pattern matches only lines have absolutely no content, no spaces... nothing. If you want to delete lines that might contain whitespace (tabs, spaces), then you may want to try this SED command: 0,/^[[:space:]]*$/{//d}
"//d" defines that the script is to delete the found matched pattern.
For more details on this SED script see: https://unix.stackexchange.com/questions/75424/remove-only-the-first-blank-line-sed.
So, to remove the first blank line from the output of each SQL file, A.sql and B.sql, they must be executed separately using SQLcl and then the output must be piped from SQLcl through the following SED script as follows:
$SQLDEV_HOME\sqldeveloper\bin\sql -s scott/tiger@XE @A.sql | sed -f remove-first-blank-line.sed > A.txt
$SQLDEV_HOME\sqldeveloper\bin\sql -s scott/tiger@XE @B.sql | sed -f remove-first-blank-line.sed > B.txt
The "-s" is the "silent" option for SQLcl (like SQL*Plus) which ensures that there is no database login information output to cluttter up your output file.
The "|" character pipes all output from SQLcl through the given SED script.
The ">" writes all output of the SED script to your output file "mysql.out". If you need to append more data to this same file using another SQL script, then use ">>" so that you can append data to the file instead of overwriting the file.
NOTE: Yes, you could also use the SED command directly on the command line, but this often requires escaping special characters in different ways depending on which OS you are running on. I find that I am much more likely to be able to re-use my SED scripts across various platforms (e.g., Linux and Windows) when I keep the SED commands in short well-named SED script files.