Hi All,
I have a binary file which is being exported from a Database, and i need to convert that to ASCII format. How can i achieve that? And this solution should work for any file which is given to us; means they will give different files from different tables.
Hi Scoot,
THanks for the reply, As i told its a file extracted from a database table with '~' as a delimitter; The file might contain arbitrary No. of columns each time. Strings is not converting the entire file properly as expected. Is there any other command/script that will help me?
Actullay converting to ASCII is enough - After converting i need to scp that file to another server and it will be consumed by some other downstream applications
The converse is just to check whether the file file has been converted properly or not.
The file will have data extracted from a table. A mix of character, date, number and everything.
Is this helpful, please lemme know if u need more details?
data is the most generic of terms and could mean anything. Assuming you mean it's the result of some SQL query, then you still need to post some of it before anyone can know what to do with it. And you need to be much more specific about what you mean by converting it to ASCII. Without knowing exactly what you mean by data and without seeing some of it, I don't know how you can expect any help here.
I will try to post some of the data, watever i have it has some PII so this is the information i have as of now
� 'Binary' = 2-byte integer, n, followed by n bytes of data. In this format:
� The data is prefixed by a record-length marker.
[LEFT]� The record-length marker does not include the length of the marker
itself.[/LEFT]
� The record-length is not part of the transmitted data.
If possible you can help me with this if not i will try to post some sample data. but if i try to open the .dat file it shows junk character is that the expected behaviour? THanks.
If the file isn't ASCII, it will look like junk. A text editor can't make sense of it because there's nothing to make sense of -- it won't know which bytes are supposed to be what data when everything's stored raw.
This is why we need the file, and a good description of it. Either by itself is only half the problem.