Skip to content
Studytrails

Tutorials in ML, AWS, R and Java

  • Amazon AWS
  • Json
    • Jackson
    • GSON
  • frameworks
    • spring
    • hibernate
  • R
    • RServe
    • RJava-Eclipse-Plugin
    • Core
  • blog
  • Source Code

use awk to add/subtract values from a column in csv file

December 5, 2015 by user

awk -F "," '{printf "%3.6f,%3.6f\n",($1 - 1),$2}' file.txt
This command reads a file called file.txt and then subtracts 1 from the first row. %3.6 is used to format the output columns. The output can be redirected to another file.

Categories blog
Post navigation
cat all files recursively in a directory
Systemd and Systemctl – services, units and run levels

Recent Posts

  • CloudFormation for SageMaker instance
  • Kubernetes Course : 2. Static Website Deployment
  • Local DNS Resolution for EKS with private endpoint
  • What is Kubernetes – simple Introduction
  • Docker container – easy to understand introduction

Recent Comments

  • Paul on Java Google Json (Gson) Introduction
  • Henrik Winsnes on Java Gson – Building json from java (Data-Binding)
  • Meepa on Using Imports in Java and importing packages
  • Güray on List all Objects in R
  • cloudkatha on Aws solution architect associate certification tips
© 2021 Studytrails • Built with GeneratePress