Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 am not getting desired output with below awk command. I want to cut column number 4 using awk with below but it is not fetching the right column. As per my knowledge it should pick one or spaces in a same way . But while Pasting my file content over here . I find *(stars) that i cannot see in vi and notepad++. Any idea for the issue ? How can i find in future as well
I am sure there is a preprocess (prior programme) which you have not mentioned, where the sequence of one or more stars is replaced by a space and the output has been put in /tmp/ip Also you have pasted the original file (input to the prior programme).
Hi I have been trying 4 hours now i have some text as follows HASH####7hAZ1BoLTM#### all i want is the 7hAZ1BoLTM i have tried countless variations but i either get nothing or the whole line just prints again not just the test that i want
awk '/####/{a=1};a;/####/{exit}' test.txt
Firstly, please do not hijack someone else's question and simply ask your own. Try setting the field separator appropriately. See [url=http://www.gnu.org/software/gawk/manual/html_node/index.html]here[\url] for more details.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Your file, as shown in your post, appears to have non printing characters embedded in it (that you don't want embedded).
You can use the od utility to dump the file in octal or hex or ASCII (read the manual page for the utility) which will help you identify what those asterisks are so you can get rid of them -- you probably want to look at whatever is writing the file first as it is probably inserting values in your file (those values will be non printing characters but will be embedded in the file). You can also invoke vi so that it will show you non printing characters but I just can't remember right now how to do that (I'll keep looking).
It might be useful to attach your file to a post so that we can take a look at it and perhaps identify the problem (you could also give a link to your system if that's possible).
You may find this article interesting. Displaying the non-breaking spaces only seems to work in vim, though. That said, if I suspected rogue characters in my files, I'd inspect them with a hex editor.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Oops!
Just noticed that the last line of the file cdup.txt is missing (why I do not know) and I can't figure out how to delete the file in the post above so here's the corrected file file.
Thanks millgates. I have gone through the link. I am able to identify the special characters but still not able to remove special characters in vim editor.
I ran `:set nolist` but it just remove the special character but doesn't remove special character permanently.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.