Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-04-25 02:46:18
Point:250 Replies:6 POST_ID:828483USER_ID:11059
Topic:
PHP Scripting Language;;JavaScript
I get one csv file with the following simple structure saved in ANSI format
1,2,3
4,5,6
7,8,9
The total size in my window folder show the size is 30byte , so I try to count it , every data is two byte in ASCII format
so there should be 2 byte * 5 data in 3 rows (including ",")= 30 Bytes but I wonder why that doesn't include
line-return two byte for every row. The line-return code should be inside of the csv file, otherwise how
can I extract the csv file data from recongizing every line by line-return, for example, we are using
var dataRows = data.split( "" ); in javascript to move next line, or $line_of_text = fgetcsv($file_handle, 1024) in php.
If it is true, it should be total size= 36 bytes instead of 30 bytes. ? OR for ANSI file, window doesn't count
line-return byte for the final size of the file ?
Please advise.
Duncan
var dataRows = data.split( "" )
1,2,3
4,5,6
7,8,9
The total size in my window folder show the size is 30byte , so I try to count it , every data is two byte in ASCII format
so there should be 2 byte * 5 data in 3 rows (including ",")= 30 Bytes but I wonder why that doesn't include
line-return two byte for every row. The line-return code should be inside of the csv file, otherwise how
can I extract the csv file data from recongizing every line by line-return, for example, we are using
var dataRows = data.split( "" ); in javascript to move next line, or $line_of_text = fgetcsv($file_handle, 1024) in php.
If it is true, it should be total size= 36 bytes instead of 30 bytes. ? OR for ANSI file, window doesn't count
line-return byte for the final size of the file ?
Please advise.
Duncan
var dataRows = data.split( "" )
Author: duncanb7 replied at 2024-04-25 04:15:32
Thanks for your reply.
Author: duncanb7 replied at 2024-04-25 04:14:18
In ASCII table, FF is presenting 1 byte only 4-bit + 4bit =8-bit or one byte for keyboardsystem that is not
same as a char of "FF"
So it is clarifed ,
same as a char of "FF"
So it is clarifed ,
Accepted Solution
Expert: yadaya replied at 2024-04-25 04:13:51
250 points GOOD
I look into ASCII code table
it specified those key in 2 byte such as 2C(hex) for ",".
"2c " not two bytes, its one byte.
Byte = 8 bit or 0-255 in decimal, 00-FF in hex/
it specified those key in 2 byte such as 2C(hex) for ",".
"2c " not two bytes, its one byte.
Byte = 8 bit or 0-255 in decimal, 00-FF in hex/
Author: duncanb7 replied at 2024-04-25 04:08:06
Because when I edit it in Excel and save it into csv file so it will create space when you hit return for next cell edit
so 1,2,3 will be 1 ,2 ,3 shown in notepad++, And if true, every key is one byte and control-key like "" is two byte. So every row will be 3 space+ 3 number +2 of "," + ""=10 byte, and 3 row*10=30 byte for total size.
You could test it in notepad++
Number and char or space is also in 1 byte, Control-key is 2 byte.
so 1,2,3 will be 1 ,2 ,3 shown in notepad++, And if true, every key is one byte and control-key like "" is two byte. So every row will be 3 space+ 3 number +2 of "," + ""=10 byte, and 3 row*10=30 byte for total size.
You could test it in notepad++
Number and char or space is also in 1 byte, Control-key is 2 byte.
Author: duncanb7 replied at 2024-04-25 03:40:22
http://en.wikipedia.org/wiki/File:ASCII_Code_Chart.svg, I look into ASCII code table
it specified those key in 2 byte such as 2C(hex) for ",".
IS my concept wrong, the ASCII table is for keyboard only not for file system ?
it specified those key in 2 byte such as 2C(hex) for ",".
IS my concept wrong, the ASCII table is for keyboard only not for file system ?
Expert: yadaya replied at 2024-04-25 03:02:25
--> "," not a two byte integer, just one byte char. so:
2*9(two byte integer) = 18
+
6( ",")
+
3*2("")
=
30 bytes
2*9(two byte integer) = 18
+
6( ",")
+
3*2("")
=
30 bytes