Conversion of Binary csv file


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Conversion of Binary csv file
# 1  
Old 07-11-2017
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

Code:
<FF><FE>1^@,^@S^@1^@_^@5^@0^@2^@0^@4^@,^@M^@u^@s^@_^@C^@h^@,^@T^@A^@A^@G^@G^@C^@G^@A^@-^@G^@C^@G^@T^@A^@A^@G^@A^@
^@2^@,^@S^@2^@_^@7^@6^@7^@7^@5^@,^@M^@u^@s^@_^@C^@h^@,^@C^@G^@T^@A^@C^@T^@A^@G^@-^@G^@C^@G^@T^@A^@A^@G^@A^@
^@3^@,^@S^@3^@_^@7^@9^@1^@3^@5^@,^@B^@r^@_^@C^@h^@,^@A^@G^@G^@C^@A^@G^@A^@A^@-^@G^@C^@G^@T^@A^@A^@G^@A^@
^@4^@,^@S^@4^@_^@7^@9^@1^@4^@8^@,^@B^@r^@_^@C^@h^@,^@T^@C^@C^@T^@G^@A^@G^@C^@-^@G^@C^@G^@T^@A^@A^@G^@A^@
^@5^@,^@S^@5^@_^@7^@9^@8^@4^@3^@,^@B^@r^@_^@C^@h^@,^@G^@G^@A^@C^@T^@C^@C^@T^@-^@G^@C^@G^@T^@A^@A^@G^@A^@

is there a way to remove the characters and keep the file as a binary file ? I tried the following that technically works but this does not keep the file binary anymore

Code:
iconv -f UTF-16LE -t UTF-8 config.csv > conv_config.csv

# 2  
Old 07-11-2017
I don't think "binary" csv- files exist. The csv format was created to exchange data between systems in text form, fields separated by comma (or semicolon or ...). Trying iconv was a brilliant idea! So - use as is after conversion.
# 3  
Old 07-11-2017
When i try to open the file in ReadHat, this is what it says
Code:
NBN@myComp:/mnt/NB/pipeline$less -S config.csv
"config.csv" may be a binary file.  See it anyway?

So I can continue to use iconv ?
# 4  
Old 07-11-2017
Well, does it work? If yes, yes. If no, no.
# 5  
Old 07-12-2017
Do you mean:-
Code:
if [ it-works ]
then
   continue-to-use-iconv
else
   try-another-way
fi

Smilie


I suppose the real question is why you need it as a "binary file"? (not simple ASCII display text)

If you want to extract the content for some purpose, then any way to get at it that works is valid. If you want to update the file, then that's another question.

What do you actually want to achieve? If you can give us an idea of your thoughts then there may be an alternate way. It might help to say why you need a "binary file" in the first place.



Kind regards,
Robin
# 6  
Old 07-12-2017
I don't believe s/he wants / needs a binary file. It seems more to be a discrepancy in (default?) coding between the two nodes.
# 7  
Old 07-13-2017
Maybe the Red Hat file was accidentally encrypted. Easily done if one exits from vi using X instead of x. Post 3 indicates that the file is not text on the source machine.
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