repeat pattern without using excel

I have a file that I need to reiterate all the lines. This is a text file with pipe delimeters, four fields and 133 lines.

file1.txt
-----
0 | 0 | 1 | random TEXT1 |
0 | 0 | 2 | random TEXT2 |
0 | 0 | 3 | random TEXT3 |
...
0 | 0 | 133 | random TEXT133 |
-----

Now, I need all 133 lines to re-iterate themselves and change only the 2nd field to a 1, and then a 2. my resulting file would then look like this:

file2.txt
-----
0 | 0 | 1 | random TEXT1 |
0 | 0 | 2 | random TEXT2 |
0 | 0 | 3 | random TEXT3 |
...
0 | 0 | 133 | random TEXT133 |

0 | 1 | 1 | random TEXT1 |
0 | 1 | 2 | random TEXT2 |
0 | 1 | 3 | random TEXT3 |
...
0 | 1 | 133 | random TEXT133 |

0 | 2 | 1 | random TEXT1 |
0 | 2 | 2 | random TEXT2 |
0 | 2 | 3 | random TEXT3 |
.
.
.
0 | 2 | 133 | random TEXT133 |
-----

Notice the 2nd column is incrementing by +1 for each reiteration. everything else stays the same per line. I see that this would be pretty simple to do in excel or something, but I'd rather use a command or a script.

try this code(bash):

#!/bin/bash

#constants
CNT=10
SOURCE="file1.txt"
RESULT="file2.txt"

#copy first field to file2.txt from file1.txt
cat $SOURCE > $RESULT
printf "\n" > $RESULT

#iterate $CNT times, and append the modified content into the file1.txt in each time
for((i = 1; i < $CNT; i++ ))
do
   awk -F'|'  '{$2=val; print $1"|"$2"|"$3"|"$4"|"}' val=$i $SOURCE >> $RESULT
   printf "\n" >> $RESULT
done

#exit normally
exit 0

you can modify the CNT=?, and run it!

.Aaron

$ cat aj.txt
0|0|1|random TEXT1|
0|0|2|random TEXT2|
0|0|3|random TEXT3|
0|0|4|random TEXT4|

$ for i in `seq 0 4`
> do
> awk 'BEGIN{OFS=FS="|"}{$2+="'"$i"'"}{print}' aj.txt >> aj.mod
> done

$ cat aj.mod
0|0|1|random TEXT1|
0|0|2|random TEXT2|
0|0|3|random TEXT3|
0|0|4|random TEXT4|
0|1|1|random TEXT1|
0|1|2|random TEXT2|
0|1|3|random TEXT3|
0|1|4|random TEXT4|
0|2|1|random TEXT1|
0|2|2|random TEXT2|
0|2|3|random TEXT3|
0|2|4|random TEXT4|
0|3|1|random TEXT1|
0|3|2|random TEXT2|
0|3|3|random TEXT3|
0|3|4|random TEXT4|
0|4|1|random TEXT1|
0|4|2|random TEXT2|
0|4|3|random TEXT3|
0|4|4|random TEXT4|

//Jadu

Hey thanks for the replies! that looks great! Yall are awesome! hey my name is Aaron too. thx again!!!