Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a file that is a pair list with separators. The list was Ctrl + c copied from a Windows Registry key. I pasted the list into Notepad, saved the file with ANSI encoding and brought it to Linux.
I cannot identify the separator characters, but I have this:
Code:
$ od -c file.txt | head
0000000 a l t e r a c 343 o 001 a l t e r a
0000020 347 343 o 002 a l t e r a c 365 e s 001 a
0000040 l t e r a 347 365 e s 002 b r a z i l
0000060 001 B r a z i l 002 c a t a l g o 001
0000100 c a t 341 l o g o 002 c i r c u n t
0000120 a n c i a s 001 c i r c u n s t 342
0000140 n c i a s 002 c l e n t e 001 c l i
0000160 e n t e 002 c o n f i g u r 347 343 o
0000200 001 c o n f i g u r a 347 343 o 002 c o
0000220 n f i g u r a c 343 o 001 c o n f i
The two separators are obviously 001 and 002. I'm sure of it because I can easily tell the words (in Portuguese) that they are separating.
Now I need to know what characters those separators are so I can produce them in a script and build a new list to be pasted back into the source.
My questions: what characters are those (give me the fish) and how does one find out exactly what characters they are in situations like this (teach me how to fish)?
001 and 002 are not displayable chars (these are control chars). What is even worse: this is not a plain text file, but a binary.
You can obviously put these chars in a file, see for example here: https://www.unix.com/shell-programmi...cter-bash.html
The list was Ctrl + c copied from a Windows Registry key. I pasted the list into Notepad, saved the file with ANSI encoding and brought it to Linux.
I'm not sure this would preserve the original encoding intact. I'd rather reg save on Windows, then copy the file to Linux and work with it.
Quote:
Originally Posted by lucmove
what characters are those
Code:
$ ascii 0o1 0o2
ASCII 0/1 is decimal 001, hex 01, octal 001, bits 00000001: called ^A, SOH
Official name: Start Of Header
ASCII 0/2 is decimal 002, hex 02, octal 002, bits 00000010: called ^B, STX
Official name: Start of Text
$ ascii 0o1 0o2
ASCII 0/1 is decimal 001, hex 01, octal 001, bits 00000001: called ^A, SOH
Official name: Start Of Header
ASCII 0/2 is decimal 002, hex 02, octal 002, bits 00000010: called ^B, STX
Official name: Start of Text
!! Flashback to debugging data flows over dedicated modems by analyzing the bits...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.