Skip to content
Studytrails

Tutorials in ML, AWS, R and Java

  • Amazon AWS
  • Videos
  • R
    • RServe
    • RJava-Eclipse-Plugin
    • Core
  • Machine Learning
  • java
    • frameworks
    • Json
      • Jackson
      • GSON
  • Kubernetes

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
cat all files recursively in a directory
Systemd and Systemctl – services, units and run levels

Recent Posts

  • An easy introduction to LLM agents – structure and components
  • Enforce tagging for SageMaker training job
  • Introduction to scaling Large Model training and inference using DeepSpeed
  • Understand CLIP (Contrastive Language-Image Pre-Training) — Visual Models from NLP
  • Amazon S3 lifecycle policies

Recent Comments

  • JSON in Java | Baeldung on Java Google Json (Gson) Custom Serializer
  • Candy on List all Objects in R
  • Biuro Nieruchomości Warszawa on Understand CLIP (Contrastive Language-Image Pre-Training) — Visual Models from NLP
  • Dan on Print values on R console or file using cat() or print()
  • srujana on CloudFormation for SageMaker instance
© 2025 Studytrails • Built with GeneratePress