Skip to main content
added 168 characters in body
Source Link
Romaxx
  • 23
  • 1
  • 4

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v jj="$j" '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

Now the following was the solution

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v k=$j '{print $k}' data/damper.test_temp1.csv) done 

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v jj="$j" '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v jj="$j" '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

Now the following was the solution

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v k=$j '{print $k}' data/damper.test_temp1.csv) done 
edited body
Source Link
Romaxx
  • 23
  • 1
  • 4

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v jj="$j" -F, '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -v jj="$j" -F, '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, -v jj="$j" '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

added 418 characters in body
Source Link
Romaxx
  • 23
  • 1
  • 4

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -v jj="$j" -F, '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

I use the command

varioutput=$(awk '{print $j}' OFS=, data/damper.test_temp1.csv) 

because I want to extract the j th value of a line of many values seperated by , . But when I want to use $varioutput it gives me always the whole line.

What am I doing wrong?

Actually I want to use

for ((j=1; j<=20; j++)); do varioutput=$(awk -v jj="$j" -F, '{print $jj}' data/damper.test_temp1.csv) done 

So I am quite confused now weather I should use it like above or not? I get an error, but when I use it like

for ((j=1; j<=20; j++)); do varioutput=$(awk -F, '{print $j}' data/damper.test_temp1.csv) done 

I still get the line.

Source Link
Romaxx
  • 23
  • 1
  • 4
Loading