modifying a awk line

Hi,

I want to print specific columns (from 201 to 1001). The line that I am using is listed below. However I also want to print column 1. So column 1 and 201 to 1001. What modifcations do I need to make?

Code:

awk -F'\t' 'BEGIN {min = 201; max = 1001 }{for (i=min; i<=max; i++) printf "%s", $i (i < max ? FS : RS)}'  file > file2

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

---------- Post updated at 03:14 PM ---------- Previous update was at 03:10 PM ----------

This prints COLUMNS (not rows): 201 to 1001.
Your question is confusing.
If you want to print column ONE as well:

awk -F'\t' 'BEGIN {min = 201; max = 1001 }{printf "%s" $1 FS; for (i=min; i<=max; i++) printf "%s", $i (i < max ? FS : RS)}'  file > file2

hey im sorry

also the code does not work.

hmm, it should. Do you really want to print COLUMNS not ROWS? That sounds a little bit strange, that you have a document with more than 1000 COLUMNS. Could you please provide an example of a line in your file?

sorry:

awk -F'\t' 'BEGIN {min = 201; max = 1001 }{printf "%s", $1 FS; for (i=min; i<=max; i++) printf "%s", $i (i < max ? FS : RS)}'  file > file2

yeah there is thousands of columns and I want to print column 1 and 201 to 1001