DATA AHEAD toolkit support Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Extra line added (We need a "write row" function)

Solved!
Go to solution

It's been a while since I used XLR8. I have attached a sub-vi that opens a file, creates the sheets, and writes column headers.

When I run this I see it is putting an extra line in and placing the headers on line 2 instead of line 1 on the empty sheet.

I am guessing because we only are given a choice of writing one cell at a time or writing an area that requires a 2d array input.

As you see I use build array to make the 1d array into a 2d array. Could this be where the extra line is coming from?

I have to say 99.9999999% of the time when writing data files I am writing a 1d array of values to a single line in a data file.

Please create a Write Row and/or Append Row function that will accept a 1d array input of any type and write it to the next row (append) or specified row (Write) with programmable start column but default to starting at column 1.

========================
=== Engineer Ambiguously ===
========================
Download All
0 Kudos
Message 1 of 6
(7,284 Views)
Solution
Accepted by topic author RTSLVU

Thank you for your feedback.

If you use the function 'Append Area' the tool checks the last row number and increases it by one. If the sheet is empty the last row function returns 0. So writing starts at line one.

Next version we will fix this bug so that writing starts at line 0 if the sheet is empty and we will think of adding the functions: ‘Write Line’ and ‘Append Line’.

For now please use the function ‘Write Area’ for the first line

0 Kudos
Message 2 of 6
(6,649 Views)

Thanks, I did not realize I grabbed the append not the write.

Also thinking about my request for a "write row", take a look at the Write Delimited Spreadsheet.vi (LV2015)

It has both a 1d and 2d input, but you can only use one or the other.

Why not make the write and append vi's in XLR8 work like that?    

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 6
(6,649 Views)

Speaking of "Line 0", there is no line 0, Excel starts with "Line 1" and "Column A"

If I want to write to line 2 column C would that be line 2 and column 3 or line 3 and column 4?   

I am guessing line 2 column 3.          

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 6
(6,649 Views)

Maybe this is a bit confusing:

First cell in Excel is Line 1, Column A.

The indexes of out tool starting at 0. So first cell with XLR8 is Line 0, Column 0.

Message 5 of 6
(6,649 Views)

Thanks, I figured that out. It's been a long time since I have use XLR8 and now I am beginning to remember all the little annoynces it has.

For instance "Get Last Row" returns a value based on the first line being 1 not 0 so to actually get the last row for formating a column or writing an area you need to add 1 to the output of Get Last Row.

It would be nice if XLR8 was consistant with the first row or column being 0 or 1.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 6
(6,649 Views)