Sponsored Content
Top Forums Shell Programming and Scripting Convert binary file to csv and then back to the binary format Post 302747563 by DGPickett on Friday 21st of December 2012 03:33:29 PM
Old 12-21-2012
It is at the top of your C file. A struct is a structure of data, and the file seems to be a pile of structures, except an empty structure is legal. The binary image has a structure count at the front, and then each structure has a length, and if it is zero, that structure is empty. There may be other flags in the structure to identify what is in the length. The confusing thing is all the #define type stuff in the structure definition, which is most of the file. I might be good to make a preprocessed file (cc -E) where that stuff is resolved. Once you have the C, you may find it is easier enough to get configuration from some other file type. XML is also popular for C++/JAVA to represent objects in collection objects ad infinitim.

Many fine C tutorials online for free, and gcc is free, too.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to convert binary Unix file to text

Hi all, I have a print control file (dflt) for Oracle which is in binary. As I am going to develope an application in Window environment, I would like to reference the dflt file. But it is in binary format and I cannot access it. Anyone can suggest me how to convert the file into text or... (5 Replies)
Discussion started by: user12345
5 Replies

2. Programming

Reading a binary file in text or ASCII format

Hi All, Please suggest me how to read a binary file in text or ASCII format. thanks Nagendra (3 Replies)
Discussion started by: Nagendra
3 Replies

3. Programming

how to write a file to binary format in C ?

I'm in the Solaris environment. I want to write data to a file, but I don't want it to be easily read from the C shell. For example, here's my code: main () { FILE *fo; fo = fopen ("filename", "w"); fprintf (fo, "This is a test.\n"); fclose (fo); } Anyone can open up... (3 Replies)
Discussion started by: serendipity1276
3 Replies

4. Shell Programming and Scripting

Is there any script which convert binary file to CSV format

Dear guys; I have a binary file and I need to convert its data to csv format ...appreciating your help. Best Regards (14 Replies)
Discussion started by: ahmad.diab
14 Replies

5. UNIX for Dummies Questions & Answers

Converting binary file to readable format in Ksh

In Unix/Ksh, when I try to look inside a file it says that the file may be a binary file and if I want to see it anyway. When i say 'yes', it shows me the content filled with unreadable symbols (looks like binary). Is there a command that I can run from the Unix prompt to convert/translate that... (3 Replies)
Discussion started by: arthurs
3 Replies

6. UNIX for Dummies Questions & Answers

convert a .tr file to binary in cygwin

I would like to convert a .tr file to a binary file to use for trace purposes. Can anyone provide any insight? (0 Replies)
Discussion started by: sparklezilla3
0 Replies

7. Shell Programming and Scripting

Convert jpg file to binary format

Hi Team, Here's the requirement. I have a image file in jpg format in unix. Now I need to i. convert the jpg format to binary format ii. followed by loading the binary file to Oracle db. Can anyone help me out? Thanks Krishnakanth Manivannan (4 Replies)
Discussion started by: kmanivan82
4 Replies

8. Shell Programming and Scripting

Convert Binary File To Hex In Linux

dHi, I have the attached file(actual file can be extracted post unzipping it) & i am trying to use the following code for coversion to hex format. Starting hex value is 84 which is start of the record & termination is done using 00 00 followed by 84(hex) which i can see in the dump clearly using... (14 Replies)
Discussion started by: siramitsharma
14 Replies

9. UNIX for Beginners Questions & Answers

Conversion of Binary csv file

Hello, I have a binary csv file that was created on 'Red Hat Enterprise Linux Server release 6.6'. Now we have transferred all files on Ubuntu 16.04.2 LTS/xenial On opening the file in Ubuntu, there are special characters ... (8 Replies)
Discussion started by: nans
8 Replies

10. Programming

DB2 convert digits to binary format

Dear Team We use DB2 v10.5 and using DBArtisan tool Can someone please guide how to convert digits to binary numbers using db2 feature. Ex> for number 9 , binary should be 1001 ( 8+1) Any help appreciated. Thanks (2 Replies)
Discussion started by: Perlbaby
2 Replies
Distances(3)						     Hardware Locality (hwloc)						      Distances(3)

NAME
Distances - Functions static inline struct hwloc_distances_s * hwloc_get_whole_distance_matrix_by_depth (hwloc_topology_t topology, unsigned depth)" static inline struct hwloc_distances_s * hwloc_get_whole_distance_matrix_by_type (hwloc_topology_t topology, hwloc_obj_type_t type)" static inline struct hwloc_distances_s * hwloc_get_distance_matrix_covering_obj_by_depth (hwloc_topology_t topology, hwloc_obj_t obj, unsigned depth, unsigned *firstp)" static inline int hwloc_get_latency (hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2, float *latency, float *reverse_latency) Function Documentation static inline struct hwloc_distances_s* hwloc_get_distance_matrix_covering_obj_by_depth (hwloc_topology_ttopology, hwloc_obj_tobj, unsigneddepth, unsigned *firstp) [static, read] Get distances for the given depth and covering some objects. Return a distance matrix that describes depth depth and covers at least object obj and all its children. When looking for the distance between some objects, a common ancestor should be passed in obj. firstp is set to logical index of the first object described by the matrix. The returned structure belongs to the hwloc library. The caller should not modify or free it. static inline int hwloc_get_latency (hwloc_topology_ttopology, hwloc_obj_tobj1, hwloc_obj_tobj2, float *latency, float *reverse_latency) [static] Get the latency in both directions between two objects. Look at ancestor objects from the bottom to the top until one of them contains a distance matrix that matches the objects exactly. latency gets the value from object obj1 to obj2, while reverse_latency gets the reverse-direction value, which may be different on some architectures. Returns: -1 if no ancestor contains a matching latency matrix. static inline struct hwloc_distances_s* hwloc_get_whole_distance_matrix_by_depth (hwloc_topology_ttopology, unsigneddepth) [static, read] Get the distances between all objects at the given depth. Returns: a distances structure containing a matrix with all distances between all objects at the given depth. Slot i+nbobjs*j contains the distance from the object of logical index i the object of logical index j. Note: This function only returns matrices covering the whole topology, without any unknown distance value. Those matrices are available in top-level object of the hierarchy. Matrices of lower objects are not reported here since they cover only part of the machine. The returned structure belongs to the hwloc library. The caller should not modify or free it. Returns: NULL if no such distance matrix exists. static inline struct hwloc_distances_s* hwloc_get_whole_distance_matrix_by_type (hwloc_topology_ttopology, hwloc_obj_type_ttype) [static, read] Get the distances between all objects of a given type. Returns: a distances structure containing a matrix with all distances between all objects of the given type. Slot i+nbobjs*j contains the distance from the object of logical index i the object of logical index j. Note: This function only returns matrices covering the whole topology, without any unknown distance value. Those matrices are available in top-level object of the hierarchy. Matrices of lower objects are not reported here since they cover only part of the machine. The returned structure belongs to the hwloc library. The caller should not modify or free it. Returns: NULL if no such distance matrix exists. Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.4.1 Mon Feb 27 2012 Distances(3)
All times are GMT -4. The time now is 02:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy