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.
Hello,
Can anyone plz suggest a way to accomplish the following:
I have a semi-column ( separated text file which has coumn headers in the first line and the values in the lines that follow. I need a script that would skip the first line with the column headers and fetch me only the values that follow.
Hi,
The second command works...thanks. But just to understand: when I issue the first command it just goes to next line on the console...doesn' do anything. Am I doing something wrong? I issued the command:
awk 'NR > 1 {print $0} Test
where Test is the name of my file.
I wrote a small script in perl on the fly which solves the problem you have described.
filename: original file
newfilename: new file with first line of original file truncated
#! /usr/bin/env perl
open (INFILE, "filename")|| die ("File not found. Program exits!");
open (NEWFILE, ">newfilename") || die ("Could not create file _newfilename_. Program exits!");
my @file = <INFILE>;
print NEWFILE @file[1..$#file];
close(NEWFILE);
close(INFILE);
store the above given code in a file and execute it in the same directory as your original file.
Hi Luqman,
Can you plz reply to my earlier post on corrupt hard-disk problem. I know you suggested to use bootable cd and then re-mount root partition....but how do I mount the root partition after I boot using the bootable cd.
I just had a look at the gawk home pages and I realise now what you mean.
The two slashes signify a regular expression ("man awk" or the link above for more on these - they're for matching patterns). If you just specify a regexp, e.g. awk '/ABC/ {print $0}' file, awk will return any lines with the text "ABC" in them. As we're trying to return everything beyond the first record, regexp's aren't apropriate.
Also, the slashes and single quotes create difficulties with the t and c shells. In fact if you search the link above, you'll see that the author says "If you use csh, you're on your own".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.