1

I'm new to this site and to programming generally. I need to get a value from a specific cell in a csv file (data is comma separated and none of the data contains spaces) and assign it in bash to a variable (so it becomes constant value), to use it in next operations. For example:

x="c8 cell value"

Could someone please help me with this?

As I said I'm not an expert and if someone could explain me how should I do it and what every command in the potential solution means would be perfect.

AlG
  • 14,697
  • 4
  • 41
  • 54
Banshee888
  • 11
  • 1
  • Post an example of the relevant csv lines. – pasaba por aqui Jul 20 '15 at 18:12
  • Since this question isn't an exact duplicate since it's also about assigning variables in Bash to the output of a command... you can use: x=\`awk -F"," ' FNR == 8 {print $3 } '\` The backticks around the command are the key here. – JNevill Jul 20 '15 at 18:35
  • Not a duplicate. The OP wants to assign it to a variable, and wants that variable to be a constant value (thus requiring the "readonly" keyword.) – pooley1994 Jul 20 '15 at 20:42

0 Answers0