LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while writing the data into the excel file

Dear All,

           I have a single dimensional array of n numeric datas and some strings to write into the excel file.

           For those single dimensional numeric data, i am converting those one dimensional data into the string with "Array to Spreadsheet string" function and after that i am concatentaing the strings with those datas.

          But when i concatenate those strings, those strings always comes into the next line in the excel file, and which should not happened, i want tose strings to be in the same line and at the same position after those numeric datas, and i think why this is happening is, there is a line feed code written inside the function "Array to  Spreadsheet string", but i am not able to modify the code.

          So is there any other alternative available to this? Can anybody provide me some info on this? or is it possible to modify the "Array to Spreadsheet sting" function?

Thanks in Advance,
Nishant
0 Kudos
Message 1 of 7
(3,304 Views)

Hi Nishant

I hope you are doing well. I have shown you three ways to this

The first is to search for \r\n and replace it with an empty string

The second converts to U8 array reverses it, deletes the first two elements, reverses the new array and convert back string.

The third uses match substring to find the \r\n and extract the string before the match.

David

Message Edited by David Crawford on 10-11-2006 08:31 AM

0 Kudos
Message 2 of 7
(3,301 Views)
Dear David,
 
               Thanks for the help, but the thing is when i tried to find the string \r\n, it couldnt find the string and therefore cannot replace it with the blank string, so could it be another char instead of '\r\n', or is there any other method is there to find the perfect char?
 
Thanks,
Nishant
0 Kudos
Message 3 of 7
(3,299 Views)
Strange....
 
Please forgive my question but I want to make sure that the string constant with \r\n is set to '\' Codes Display. If you do the \r\n in a '\' code display string constant it will look like \\r\\n (not a hyperlink) which won't work.
 
Just in case you didn't know you can set '\' Codes Display buy right clicking and making the appropriate select in the context menu.
 
David
0 Kudos
Message 4 of 7
(3,295 Views)

I forgot to ask what version of labview are you using?

I can post the example

David

0 Kudos
Message 5 of 7
(3,289 Views)

Dear David,

       There is no sorry in help, you have help me that is the big thing, neways but i couldnt understand this reply, i dont know what you are trying to say?

           I am using LabVIEW 7.1.

Thanks,

Nishant

Message Edited by Nishant on 10-11-2006 04:52 AM

0 Kudos
Message 6 of 7
(3,289 Views)

OK just re-read what I wrote and it was not quite right. When you enter the \r\n into a string constant it needs to be in \ Code Display.

If you enter \r\n into a normal string constant it will look like \\r\\n in \ Code Display which is not what you are searching for.

I have attached the example in 7.1 to let you see it in action. Hopefully it will make sense now.

David

Message Edited by David Crawford on 10-11-2006 11:10 AM

0 Kudos
Message 7 of 7
(3,282 Views)