Created
February 3, 2023 11:53
-
-
Save MikaelFangel/e89298246da839ba92e2f140ad352974 to your computer and use it in GitHub Desktop.
Print a range of columns in a csv file using awk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
BEGIN { | |
FS=","; | |
first_index = 1; | |
last_index = 3; | |
} | |
{ | |
for(i = first_index; i <= last_index; i++) { | |
printf("%s\t", $i); | |
} | |
printf("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment