# Need to get First column from the text file

**URL:** <https://community.unix.com/t/need-to-get-first-column-from-the-text-file/226009>\
**Category:** Shell Programming and Scripting\
**Created:** [December 30, 2008, 1:20am UTC](https://community.unix.com/t/need-to-get-first-column-from-the-text-file/226009 "2008-12-30T01:20:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahman\_riyaz](https://community.unix.com/letter_avatar/rahman_riyaz/32/6_22734026db12803ebb3e059622ac3534.png) [@rahman\_riyaz](https://community.unix.com/u/rahman_riyaz)\
**Post date:** [December 30, 2008, 1:20am UTC](https://community.unix.com/t/need-to-get-first-column-from-the-text-file/226009/1 "2008-12-30T01:20:17Z")

</div>

Hey Guys,

I have a very urgent requirement regaridng the searching for value on the text file.

The text file is in the below format

Number Description

"112323", mysampletest1

"12122412", mysampletest2

"11232143", mysampletest3

I need to get the first column like

112323  
12122412  
11232143

i did try with awk '{print $1}' xyz.txt

it prints the description also .

CAn you please suggest as to which command can make the above requiremet possoble.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ynilesh](https://community.unix.com/user_avatar/community.unix.com/ynilesh/32/699_2.png) [@ynilesh](https://community.unix.com/u/ynilesh)\
**Post date:** [December 30, 2008, 1:28am UTC](https://community.unix.com/t/need-to-get-first-column-from-the-text-file/226009/2 "2008-12-30T01:28:56Z")

</div>

try this,

```nohighlight
awk -F , '{print $1}' abc.txt

```

- nilesh

---

<div class="post-metadata">

**Author:** ![Orbix](https://community.unix.com/letter_avatar/orbix/32/6_22734026db12803ebb3e059622ac3534.png) [@Orbix](https://community.unix.com/u/Orbix)\
**Post date:** [December 30, 2008, 3:02pm UTC](https://community.unix.com/t/need-to-get-first-column-from-the-text-file/226009/3 "2008-12-30T15:02:02Z")

</div>

Try also

cut -d, -f1 abc.txt
