Answer the question
In order to leave comments, you need to log in
How to insert the value of a variable in the shell after a certain number of commas?
There are text files where the separators are commas, for example:
18,1445805860,3900,96100,20150523215740,20150523215745,5,16,17,12034543,24066520,DSFG,915,3549,1,2
I need to insert a random value that contains a variable after the 9th comma.
So that in the end there was something:
18,1445805860,3900,96100,20150523215740,20150523215745,5,16,17, 123456 12034543,24066520,DSFG,915,3549,1,2
Random values received: awk -vmin =5 -vmax=10 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
How best to insert them I can't figure out how to build a construction in SED.
You can also use other editors or perl.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question