Huỳnh Hiền
New member
How do I get the first column in Linux?
Answer
The first column of any file can be
printed by using $1 variable in awk
. But if the value of the first column contains multiple words then only the first word of the first column prints. By using a specific delimiter, the first column can be printed properly. Create a text file named students.
Answer
The first column of any file can be
printed by using $1 variable in awk
. But if the value of the first column contains multiple words then only the first word of the first column prints. By using a specific delimiter, the first column can be printed properly. Create a text file named students.