Conversion of Binary csv file


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Conversion of Binary csv file
# 8  
Old 07-13-2017
I don't understand what you mean by a binary file here as ALL files are binary, so......
......Ignoring the <FF><FE> at the start for the time being is the result below what you are looking for, OR, do you want each character pair '^@' replacing with a single NULL character and '<FF><FE>' replacing with their single binary characters for 0xFF and 0xFE?
Code:
Last login: Thu Jul 13 20:46:07 on console
AMIGA:amiga~> cd Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> ./CTRL_AT.sh
<FF><FE>1,S1_50204,Mus_Ch,TAAGGCGA-GCGTAAGA
2,S2_76775,Mus_Ch,CGTACTAG-GCGTAAGA
3,S3_79135,Br_Ch,AGGCAGAA-GCGTAAGA
4,S4_79148,Br_Ch,TCCTGAGC-GCGTAAGA
5,S5_79843,Br_Ch,GGACTCCT-GCGTAAGA
AMIGA:amiga~/Desktop/Code/Shell> _

# 9  
Old 07-14-2017
The <FF><FE> at the start is a BOM (Byte Order Mark), saying that the file is an UTF16-Little-Endian text file.
To "keep the file binary", which I read as "keep the encoding as it is", simply pipe the output of iconv to your prefered pager or whatever tool needs to process the file:
Code:
iconv -f UTF-16LE -t UTF-8 config.csv |less

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File conversion from Binary to ASCII though UNIX command

Hi All , I have a mainframe file which contains the data in EBCDIC format.I have downloaded this file from mainframe to windows in binary format(unreadable raw data).Now I want convert this file to ASCII format(readable format data) through Unix command.I have tried iconv but that is not working... (2 Replies)
Discussion started by: STCET22
2 Replies

2. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

3. Shell Programming and Scripting

perl : number to date conversion in CSV file

I have a CSV file in the below format. while generating CSV file from excel sheet , date in excel sheet(Format :Mon 8/28/2012) got converted into the below format with numbers 41148,41149 so on. Could anyone please let me know how to the convert the numbers(41148,41149 so on.) to its actual... (2 Replies)
Discussion started by: giridhar276
2 Replies

4. Shell Programming and Scripting

conversion of spaces into CSV format file

INput file attached in thread : Column widths at 24,73,82,87,121 characters (sed 's/./,/24;s/./,/73;s/./,/81;s/./,/87;s/./,/121;s/ *, */,/g' fixedinputfile >output.csv ). The client wants instead of hard coding the column widths as they are not fixed .he has given the hint stating that ( ... (3 Replies)
Discussion started by: sreenath1037
3 Replies

5. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

6. Shell Programming and Scripting

binary file conversion

Hello folks, i have a binary text file but i am not able to convert into text format, please suggest. thanks. (2 Replies)
Discussion started by: learnbash
2 Replies

7. Shell Programming and Scripting

Flat file to csv conversion

Hi Guy's can someone help me in converting the following I have a flat text file which has several thousand lines which I need to convert to a csv it's got a consistent format but basically want every time it hit's txt to create a new line with the subsequent lines comma delimited for example ... (6 Replies)
Discussion started by: p1_ben
6 Replies

8. 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

9. UNIX for Dummies Questions & Answers

Binary file conversion

All, I want to convert multiple \0 005 characters to line feed 012 character in a binary file to make to readable. Here is the sample od -c file output: 0000000 254 355 \0 005 s r \0 * c o m . c i s c Here is the sample od -b file output: 0000000 254 355 000... (0 Replies)
Discussion started by: bubba112557
0 Replies

10. UNIX for Dummies Questions & Answers

Binary data to text file conversion

Dear Sir; i want to know how the binary data convert to text file or readablw format (ASCII).If possible pl. help me for the software and where it is available for download. i.e. (1 Reply)
Discussion started by: auro123
1 Replies
Login or Register to Ask a Question