# Read flat file upto certain number of columns

**URL:** <https://community.unix.com/t/read-flat-file-upto-certain-number-of-columns/298713>\
**Category:** Shell Programming and Scripting\
**Created:** [November 7, 2011, 4:38am UTC](https://community.unix.com/t/read-flat-file-upto-certain-number-of-columns/298713 "2011-11-07T04:38:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik4891](https://community.unix.com/letter_avatar/pratik4891/32/5_5575768a8748004e209b776fc1b2916d.png) [@Pratik4891](https://community.unix.com/u/Pratik4891)\
**Post date:** [November 7, 2011, 4:38am UTC](https://community.unix.com/t/read-flat-file-upto-certain-number-of-columns/298713/1 "2011-11-07T04:38:09Z")

</div>

Hello Guys

Please help me with the below issue

I want to read a flat file source upto certain number of columns  
Say my flat file has 30 columns but I want to read upto 25 columns only

How come the above issue can be addressed?

Thanks a lot!!!!

---

<div class="post-metadata">

**Author:** ![jayan\_jay](https://community.unix.com/user_avatar/community.unix.com/jayan_jay/32/1006_2.png) [@jayan\_jay](https://community.unix.com/u/jayan_jay)\
**Post date:** [November 7, 2011, 4:42am UTC](https://community.unix.com/t/read-flat-file-upto-certain-number-of-columns/298713/2 "2011-11-07T04:42:50Z")

</div>

I have given space as a delimiter here ..

```nohighlight
$ cut -d' ' -f1-25 < infile

```
