10-08-2008 10:40 PM
Hi
In my application I am using producer consumer loop architechture. In the consumer loop i am writn data from a queue to a file. I want to write data in a certain format to analyze in another program. Now when i write dat to a file it writes left justified in six columns. I want it to write to file like the one i have attached. Can somebody tell me how?
10-08-2008 11:52 PM - edited 10-08-2008 11:53 PM
Ideally, you would just use a tab as delimiter and change the justification in the other program as needed. For example in MS word you can define how the tabs are justified.
If you want the data right justified in simple text displays (wordpad, notepad), you just need to ensure that the field width is sufficient for the widest data.
Try e.g. a format specifier of "%#15_6f' (and make sure that you use a fixed width font for display!)
10-09-2008 02:30 PM
Hi
Thanks for the reply. I am using write to text file vi to write data to a file in asc2 format. i attached my part of my vi for you see how iam doing it. I i figured that if i set the width to 13 of the number to fractional string vi my data file is lright justified with 13 charaters to a column. My problem now how to get rid of the trailing zeros of the numbers. I think this would reduse the size of my file.
10-09-2008 02:31 PM
Hi
Sorry i forgot to attached picture of my vi. I also attached data file i wrote using my vi.
10-09-2008 02:42 PM
suni wrote:I am using write to text file vi to write data to a file in asc2 format.
For your reference, it is "ASCII" (American Standard Code for Information Interchange), not "asc2".
suni wrote:My problem now how to get rid of the trailing zeros of the numbers.
No, if your file is formatted with fixed width lines like this, the file size is determined by the line lenght. A "zero" character is the same size as a "space" character. 🙂
Please attach your code, it is extremely convoluted and inefficient. The code inside your case structure, if properly written(!), should be able to fit the size of a postage stamp.
10-09-2008 08:17 PM
10-09-2008 08:18 PM
10-09-2008 08:18 PM
10-17-2008 10:24 AM
altenbach wrote:
Please attach your code, it is extremely convoluted and inefficient. The code inside your case structure, if properly written(!), should be able to fit the size of a postage stamp.
Hi Altenbach
Is there anyway i can make my code afficient?