« first day (4242 days earlier)      last day (40 days later) » 

1:12 AM
@EnthusiastiC Optionally have a look at sed and -i
Unrelated; One alias I use a lot: alias jj='jobs -l && read -r j && [ -n "$j" ] && fg $j'
Alt: alias jj='jobs -l && read -r j && [ -n "$j" ] && fg "$j" || fg'
 
 
16 hours later…
5:17 PM
I have a column with labels like the following


2
6
10
8
22
20

6
18
8
12
16
I want to rename the second half of the column
in such a way, retaining the same naming but suffixed with (-)
I don't think using NR will help here since the number of lines is not fixed.
the delimiter is the line-breaking.
 
5:32 PM
I suggest one needs to rename the second occurrence of each duplicate and avoid using line breaking as a delimiter.
 
 
3 hours later…
8:15 PM
I have solved my problem with another problem but closer to the solution
awk 'cnt[$1]++{$1=$1"-\t"} {printf "%s\n", $0}')
Now I want to replace the old field
defining a new variable that contains the new labels using above awk one-liner
renamed_column
replacing it in
awk -v v=$renamed_column '{$1=v; printf "%s%s\n", $1, $2}' <<< "$array1"
Couldn't print the new first field.
 
9:17 PM
How to define a field using -v option by a shell variable being an array?
 

« first day (4242 days earlier)      last day (40 days later) »