Hi
I have the below set of lines , i need to duplicate these lines 1000 times, also eevrytime when it is incremented , it should increment the one in Blue color.
130400030000010000200001
130400030000010000200002
140050030000010000200005A
eg:
130400030000010000200001
130400030000010000200002
140050030000010000200005A
for next time ,it should be
130400030000010000300001
130400030000010000300002
140050030000010000300005A
so on till 1000 times.
how it can be done with shell script ?
ctsgnb
November 2, 2012, 6:48am
2
for i in `seq -f "%04g" 1 1000`
do
echo "130400030000010$i00001
130400030000010$i00002
140050030000010$i00005A"
done
ctsgnb
November 2, 2012, 8:07am
5
I did my test on an ubuntu distrib.
So you may need to adapt the code depending on your own OS.
Just stating "it didn't work" does not really help us to help you.
Try this:
awk 'BEGIN{c=0;while (++c<=1000) { print "130400030000010" c "00001" RS "130400030000010" c "00002" RS "140050030000010" c "00005A"}}'
your code
for i in `seq -f "%04g" 1 1000`
do
echo "130400030000010$i00001
130400030000010$i00002
140050030000010$i00005A"
done
works fine , but ill not display the numbers which are after $i .it ll only display till $i.
ctsgnb
November 2, 2012, 11:12am
7
Please copy/paste exactly what is in your script and/or what you typed .
by the way did you give a try to the awk code ?