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 Mithil Shah

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

  • Batch Normalisation
  • Distributed Machine Learning – Part 2 Architecture
  • Distributed Machine Learning – Part 1 Hardware
  • Create/drop Athena table using python in Sagemaker
  • CloudFormation for SageMaker instance

Recent Comments

  • DavidZ on Java json – jackson List serialization
  • Kumar Puran on Install Climate Data Operator (CDO) with NetCDF, GRIB2 and HDF5 support
  • 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
© 2021 Studytrails • Built with GeneratePress