Question: I need for the 5th column in a delimited text file to be reduced to just the first 5 characters. All other columns must remain unedited.

Input:

```
file1.txt    column1      column2      column3     column4      column5
123456789    123456789    123456789   123456789    123456789

```

I would like the output to look like:

```
output.txt    column1      column2      column3     column4      column5
123456789    123456789    123456789   123456789    12345

```

Note: I happen to use commas as the delimiter.

Answer: 
If `file.csv` looks like this:

```
123456789,123456789,123456789,123456789,123456789
123456789,123456789,123456789,123456789,223456789
123456789,123456789,123456789,123456789,323456789
123456789,123456789,123456789,123456789,423456789

```

Then, you can do:

```
$ awk -F, '{print $1","$2","$3","$4","substr($5,1,5) }' file.csv
123456789,123456789,123456789,123456789,12345
123456789,123456789,123456789,123456789,22345
123456789,123456789,123456789,123456789,32345
123456789,123456789,123456789,123456789,42345

```
If all the values are simple (no quotes and newlines in a value) and if they are comma separated, like:

```
123456789,123456789,123456789,123456789,123456789

```

and if there are always 5 such values on a line, you can use `sed`:

```
sed '2,$s/\(.*\),\(.*\),\(.*\),\(.*\),\(.....\)\(.*\)/\1,\2,\3,\4,\5/' input

```

The `2,$` assumes you have a header that is comma separated as well (and that its
fifth column should not be truncated), if that is not the case leave it out.