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 8735277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:01:06+00:00 2026-06-13T10:01:06+00:00

I am facing a perplexing (at least for me) problem. I’m trying to read

  • 0

I am facing a perplexing (at least for me) problem. I’m trying to read some csv files and then extract some values to make some checking and calculus. I’m using awk to access files and extract required fields.

The strange point is that the awk sentence properly runs on a bash prompt but it does not work when run in the script. As an example I get from bash prompt:

paco@NIMBUS:~/work$ awk -F\; '$1 == "21-08-2012" && $2 == "'17'" { print $3 }' niveles-rams.csv
2

but

nrams1=`awk -F\; '$1 == "'$fecha'" && $2 == "'$area'" { print $3 }' niveles-rams.csv`
echo $nrams1

does not return any value. CSV files come from an Excel in windows so maybe there could be a problem with encoding, I guess?

You can find the script validacio.bash and csv files in the following URL

  • niveles-rams.csv
  • pobles.csv
  • umbrales.csv

  • validacio.bash

Thanks for your help and patience

  • 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-06-13T10:01:07+00:00Added an answer on June 13, 2026 at 10:01 am

    In your case will be:

    nrams1=`awk -F";" -v fecha=$fecha -v area=$area '$1 == fecha && $2 == area { print $3 }' niveles-rams.csv` 
    

    as Kailash K Pawar menitioned the right method

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

Sidebar

Related Questions

Facing some problem in setting up future date. Actually I m trying to do
I am facing some unusual problem every now and then to solve I even
Im facing problem when trying to apply data annotation. In my case im passing
im facing a problem where i need some advice. I want to have a
Im facing a very annoying problem in PHP when Im trying to watermark the
facing some problem with java virtual machine initialization. when i am using root account
I am facing some issues when downloading large files in Heroku. I have to
I'm facing a really perplexing problem.. I have a .Net 2.0 C# WinForms project.
Facing problem with every fetch i want to make using EF Query model.Place here
Im facing some problem with json and objective c. Atm i am using sbJson

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.