CSV to notepad changes the decimal places - notepad

When I converted a file from CSV to notepad, the number of decimal places in the notepad changes to 4 decimal places. How can change this so that notepad can read the exact number of decimal places from CSV.
For example, I have 0.0000005 in my CSV file, but when I convert it to notepad, I now have 0.0000
Hence my number has been changed from 0.0000005 to 0.0000
How can I prevent this from happening. Note that I have the cells wide enough to be able to see the numbers in the CSV but it never exports properly to notepad.
Thanks for your anticipated help.

Related

Legacy code - looking for a function which emulates qbasic decimal to text

I could sit down a write this, but in the interests of not reinventing the wheel, I wanted to check that someone hasn't already done this.
I have to migrate over a little legacy tool which generates a text file containing a table of numeric values generated by a small tool. It was written many years back in DOS QBasic.
The only problem with the task is that QBasic had quite a few pecularities in decimal to text conversion. Lots of small exceptions.
The resultant file is imported into an old machine which works perfectly with the QBasic generated file, but when I pass it 6 or 7 digit precision decimals the results are not correct. QBasic output when writing decimals varies from 7 down to 3 digits of decimal depending on the whole number part and also generates decimals in the 0.0000E+1 format if there is no whole number part and there are zeros after the decimal point.
Has anyone seen a collection of functions which behave the same way as qbasic? Language doesn't matter. Googling hasn't turned up anything so far.

MATLAB takeing huge 350 mb memory to write one column vector to txt file

I have a variable sndpwr which have 18000 rows and just one column. When I use fprintf it takes 350mb txt file to write. Even csvwrite and dlmwrite take 200+ mb space.
Can anyone tell me any function or method that will write it in a small text file. I am importing it in another program which is not able to import such large files.
fid = fopen('sndpwr.txt','wt');
fprintf(fid,'%0.6f\r\n',sndpwr');
fclose(fid);
Thanks!
EDIt: in workspace it is described as 31957476x1 double. Sorry for my previous incorrect data.
Unfortunately, there is no way to compress your data without using an actual compression algorithm. You have 3x10^7 numbers, written with six digits after the decimal point, at least one before, and a couple of newline characters. This gives 3x10^7 * 10 = 3x10^8 bytes, as a bare minimum. Since 1MB is approximately 10^6 bytes, you are getting a file on the order or 300MB.
If you were to write the file in binary using the double datatype, the file would likely be about 20% smaller since doubles are generally 64-bit (8 byte numbers). If you were to use the single datatype, there might be some information lost since single can only hold approximately 5 digits of decimal precision, but the file would only be 40% of its current size.
If binary is not an option, you can always split the data into smaller text files.

pasting truncates text lines into an emacs buffer

I copied more than 100 lines of text and pasted it into emacs (23.1.1), but only the first 50 lines or so actually get pasted.
Is there a setting somewhere that I can poke to increase the size?
IIUC when inserting, the number of lines doesn't matter. Emacs inserts just numbers, which represent characters. The character "\n" is one of them maybe. After insertion, Emacs reads these numbers, i.e. displays a representation of these numbers as characters.
The only limitation here is the maximal amount of numbers/chars a buffer may hold. With around 80 chars in each 100 lines you are an eternity below. Assume it's just a copy error/mistake.

Matlab: Obtaining an exact decimal number from a csv file

I have a CSV file where I have decimal numbers like 1.1, 1.10, 1.100. When I load the file in Matlab using importdata or even textscan, it show all these numbers same: 1.1 discarding 0's at the end. But, I have different meaning of them.
Is there anyway to recover?
Thanks,
Sam
You're saying you mean something different by 1.1 than by 1.100000? Mathematically, they are the same number (I sincerely hope you know this already).
So if your "numbers" don't have the same meaning as numbers in any of the strictly defined mathematical number systems (which MATLAB normally assumes is the case), you should import them as strings (%s) rather than numbers (%d, %f, etc.), and process them as such.

Matlab MATPOWER Output in long format

I've been trying to use MATPOWER to do a power flow analysis for a network i have but all the outputs are coming with only 2 decimal places. Is there a way to configure the output to have the long format?
Trota,
You can modify the number of decimal places printed on screen or forwarded to the output text file.
If you browse the printpf.m file, simply change the required %9.xf to the required number of decimal places, where x is the number of digits after the decimal point. For bus data, these can be found at line 412 onwards.
Hope this helps.
You cannot change the number of decimal places used in the pretty-printed output of MATPOWER, but all of the results are available in full precision in the results struct returned by runpf() or runopf(). You can display these results with whatever precision you choose using standard Matlab commands such as disp() or fprintf().