Replace the second string in the double quotes with the first string in the double quotes 1

Replace the second string in the double quotes with the first string in the double quotes

awk -v FS="," -v OFS="," '{$2=$1;print $0}' input.text

Here is what the above code is Doing:
1. awk is a command line tool that is used to search and manipulate text files.
2. -v FS=”,” -v OFS=”,” is used to set the input and output field separator to comma.
3. $2=$1 is used to copy the first field to the second field.
4. print $0 is used to print the entire line.

Similar Posts