Hi
I have a file which contains entry similar to this one:
PX_LIST="2259 2215 270 2635 2874 2713 243 4124 2529 2874 34 477 "
Is there a efficient(short) way to use "awk" or "sed" to enter any number, lets say 7777, as the first number inside the quotes, so the result would look like this:
PX_LIST="7777 2259 2215 270 2635 2874 2713 243 4124 2529 2874 34 477 "
Thanks a lot for any information. -A
echo 'PX_LIST="2259 2215 270 2635 2874 2713 243 4124 2529 2874 34 477 "' | sed 's/PX_LIST="/&7777 /'
aoussenko:
Hi
I have a file which contains entry similar to this one:
PX_LIST="2259 2215 270 2635 2874 2713 243 4124 2529 2874 34 477 "
Is there a efficient(short) way to use "awk" or "sed" to enter any number, lets say 7777, as the first number inside the quotes, so the result would look like this:
PX_LIST="7777 2259 2215 270 2635 2874 2713 243 4124 2529 2874 34 477 "
If there is only one line in the file, you don't need sed or awk:
read line < file
line="${line%%\"*}\"4777 ${line#*\"}"