Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6565091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:02:59+00:00 2026-05-25T14:02:59+00:00

I work on unix server. I have many csv files containing, among other info,

  • 0

I work on unix server.
I have many csv files containing, among other info, date fields.

I have to replace some of this date fields with another value, for example 20110915 to 20110815. Their position is variable from a file to another.

The problem is that the substitution is position field specific. For example, if my file has row like this:

blablabla;12;0.2121;20110915;20110915;19951231;popopo;other text;321;20101010

I have to replace only first date fields and not other, transforming row in:

blablabla;12;0.2121;20110815;20110915;19951231;popopo;other text;321;20101010

Is there a way to restrict the replace in file, using some constraints?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:03:00+00:00Added an answer on May 25, 2026 at 2:03 pm

    You can try awk:

    awk  'BEGIN {FS=";";OFS=";"} {if($4=="20110915")$4="20110815"; print}' input.csv
    

    How it works:

    FS and OFS define the input and output field separators. It compares the fourth field ($4) against 20110915. If it matches, it is changed to 20110815. The line is then printed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the C / Unix environment I work in, I see some developers using
I've a unix server (mac osx in fact) which transform actually PS files to
At work, we have a situation where when script/server is run, then all the
I have written a function to convert a date into a Unix time stamp.
On my Unix web server, I have two MySQL database servers running. One on
I work in a Unix environment with the typical Unix tools (emacs, vim, gvim,
Can we use the wmain() function with Unix compilers or it'll work only on/for
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
Work on asp.net vs05. I have three type of value Like:IsDesign,IsPrinting,IsInstall they are bit
Work on this small test application to learn threading/locking. I have the following code,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.