file-format

Can a CSV file have a comment?

岁酱吖の 提交于 2019-12-17 15:35:15
问题 Is there any official way to allow a CSV formatted file to allow comments, either on its own line OR at the end of a line? I tried checking wikipedia on this and also RFC 4180 but both do not mention anything which leads me to believe that it's not part of the file format so it's bad luck to me and I should then use a seperate ReadMe.txt file thingy to explain the file. Lastly, i know it's easy for me to add my own comments in, but i was hoping that something like Excel could just import it

How to identify the file content as ASCII or binary

老子叫甜甜 提交于 2019-12-17 05:47:07
问题 How do you identify the file content as being in ASCII or binary using C++? 回答1: If a file contains only the decimal bytes 9–13, 32–126, it's probably a pure ASCII text file. Otherwise, it's not. However, it may still be text in another encoding. If, in addition to the above bytes, the file contains only the decimal bytes 128–255, it's probably a text file in an 8-bit or variable-length ASCII-based encoding such as ISO-8859-1, UTF-8 or ASCII+Big5. If not, for some purposes you may be able to

Reading selected column only from CSV file, when all other columns are guaranteed to be identical

风流意气都作罢 提交于 2019-12-14 03:53:34
问题 I have a bunch of CSV files that Im trying to concatenate into one single csv file . The CSV files are separated by a single space and look like this: 'initial', 'pos', 'orientation', 'ratio' 'chr', '106681', '+', '0.06' 'chr', '106681', '+', '0.88' 'chr', '106681', '+', '0.01' 'chr', '106681', '+', '0.02' As you can see, all the values are the same except for the ratio . The concatenated file I am creating will look like this: 'filename','initial', 'pos', 'orientation', 'ratio1','ratio2',

How to convert any format(.txt, .Doc) file into epub file in android application

大憨熊 提交于 2019-12-13 11:52:18
问题 I am developing an application in which I have to read or write any eBook. In android so many libraries available for reading any eBook, but for writing i didn't find any thing. For reading any eBook file must be in .epub format. I have an editor in which i am entering some text and after saving that file in any format how can i convert that file into .epub file. Thanks in advance. 回答1: In android Java is developer language for create APP, use Epublib (lib in java) Read "doc file" with poi

Google Protocol Buffers, backward reposition IO head in the stream objects provided

痴心易碎 提交于 2019-12-13 04:18:27
问题 I want to move the IO head to the start of a certain CodedOutputStream or ZeroCopyOutputStream so I can update a header data structure with how many protobuf messages are in the file, and how many bytes the following messages consume. The Backup function is not intended for this, any suggestions ? I am creating a file format for event data, where each file contains multiple event data-sets. I need 2 types of header entities for this (fixed size)A global one, and a per data-set one. I update

Why using unix-compress and go compress/lzw produce different files, not readable by the other decoder?

走远了吗. 提交于 2019-12-13 00:19:17
问题 I compressed a file in a terminal with compress file.txt and got (as expected) file.txt.Z When I pass that file to ioutil.ReadFile in Go, buf0, err := ioutil.ReadFile("file.txt.Z") I get the error (the line above is 116): finder_test.go:116: lzw: invalid code I found that Go would accept the file if I compress it using the compress/lzw package, I just used code from a website that does that. I only modified the line outputFile, err := os.Create("file.txt.lzw") I changed the .lzw to .Z . then

Random access image (picture) file

空扰寡人 提交于 2019-12-12 17:36:55
问题 Is there a file format (image file) that allows random access to its sections. For example, I have huge image file with resolution of 100000x100000 pixels and I want to read just one small section. Like a geomap with zoom levels. I want to write some app in Java. I could use hundreds of small files and combine them somehow, but it would be much better if there is a way to do it with one huge file (or few of them). 回答1: Your ability to do that will depend on the file format you are using for

Storing data in txt file in specific format

亡梦爱人 提交于 2019-12-12 17:12:02
问题 my question is related to my previous question (How to display data from txt file in specific format). I was wondering if it is possible at the first place, to store data on txt file in specific format rather than store it first and then retreived it again and display it in specific format? e.g. instead of store data on txt file like this Jessica Walking 20 minutes Matthew Run 10 minutes I wanted to store it in txt file in this format Jessica Walking 20 minutes Matthew Run 10 minutes 回答1:

Why do file formats have magic numbers?

我们两清 提交于 2019-12-12 10:57:49
问题 For example, Portable Executable has several, including the famous "MZ" at the beginning, as well as the "PE\0\0" at the start of the PE header. The Rar file format has the "Rar!" header at the beginning, and several others have similar "magic values" in the file. What purpose do such magic values serve? 回答1: Because users change the file extension, or other programs steal the file extension, it allows the application to cancel processing of a file in an unknown format instead of trying its

protocol buffers : no notation for fixed size buffers?

笑着哭i 提交于 2019-12-12 10:38:49
问题 Since I am not getting an answer on this question I gotta prototype and check myself, as my dataset headers need to be fixed size, I need fixed size strings. So, is it possible to specify fixed size strings or byte arrays in protocol buffers ? It is not readily apparent here, and I kinda feel bad about forcing fixed size strings into the header message. --i.e, std::string('\0', 128) ; If not I'd rather use a #pragma pack(1) struct header {...}; ' edit Question indirectly answered here. Will