Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (frostbite):

AWK syntax problem.

OpenStudy (frostbite):

I am writing to write a AWK command line to take a line from a file (X.dat) and transfer it to another document (Y.dat) based the number in column 5, I am using a loop to separate the lines and use the variable in my condition. The code looks like this: for j in 3.0 4.0 5.0 6.0 6.5 7.0 8.0 9.0 do awk "$5==${j} {print $0}" X.dat >Y.dat. The error message is: awk: =='3.0' {print} awk: ^ syntax error awk: =='4.0' {print} awk: ^ syntax error awk: =='5.0' {print} awk: ^ syntax error awk: =='6.0' {print} awk: ^ syntax error awk: =='6.5' {print} awk: ^ syntax error awk: =='7.0' {print} awk: ^ syntax error awk: =='8.0' {print} awk: ^ syntax error awk: =='9.0' {print} awk: ^ syntax error

OpenStudy (frostbite):

Issue fixed. It was a matter of global and local variables. The fixed code was the following: for j in 3.0 4.0 5.0 6.0 6.5 7.0 8.0 9.0 do awk "\$5==${j} {print $0}" X.dat >Y.dat.

NvidiaIntely (nvidiaintely):

If your still need help tag someone. If you already solved your question(which is great :) ) then make sure you close this post :)

OpenStudy (frostbite):

@NvidiaIntely I know, but I just wrote the fix and went home from work. So I left it open if people had things to add. ;)

NvidiaIntely (nvidiaintely):

Good then!

OpenStudy (frostbite):

experienced in CUDA due to your username or more gaming related? :)

NvidiaIntely (nvidiaintely):

Yeah, lol. I am a techie!

OpenStudy (frostbite):

Heh, just very few I see these days that actually take advantage of gpu acceleration, at least when it still comes to molecular dynamics.

NvidiaIntely (nvidiaintely):

Yeah xD

NvidiaIntely (nvidiaintely):

Are you working in the Frostbite engine or gaming related due to your username?

OpenStudy (frostbite):

To be honest I got no clue why I went with it.

NvidiaIntely (nvidiaintely):

oh, lol. You play Star Wars Battlefront EA?

OpenStudy (frostbite):

Nope. Not really a big gamer these days due to me being busy with my master thesis... So my gaming rack is just gathering dust :S

NvidiaIntely (nvidiaintely):

Oh, that's not good :( Well I actually know alot about building PC's. I started a channel: http://yttechy.cf/ but not much stuff on it yet lol

OpenStudy (frostbite):

That is nice. So I guess you're PC is custom build? :)

NvidiaIntely (nvidiaintely):

Yes.

NvidiaIntely (nvidiaintely):

It does not have an Nvida GPU yet because I could not afford it yet. AMD RX 480 GPU.

NvidiaIntely (nvidiaintely):

Want specs list?

OpenStudy (frostbite):

Sure. :)

NvidiaIntely (nvidiaintely):

Okay, here: http://pcpartpicker.com/list/mFrpKZ

OpenStudy (frostbite):

Expensive stuff indeed. Almost got the same in mine, GPU however is the GTX 980 TI

NvidiaIntely (nvidiaintely):

Yeah very much $$$ Also want to check my site and check 1 video maybe? http://yttechy.cf/ I am sure my video will shock you.

OpenStudy (frostbite):

wish I could smugle my university computer home :P

NvidiaIntely (nvidiaintely):

Specs of it?

OpenStudy (frostbite):

I will surely take a look tomorrow. :D

NvidiaIntely (nvidiaintely):

Well if you dk the specs, why you want it lol?

OpenStudy (frostbite):

4x GTX-Titan-X 8x Core i7 6700K This is the PC I do simulations on GPU accelerated molecular dynamics on.

NvidiaIntely (nvidiaintely):

WOW!!

NvidiaIntely (nvidiaintely):

Who would not like that lol.

NvidiaIntely (nvidiaintely):

Check my video?

OpenStudy (frostbite):

Watching the videos as we speak.

NvidiaIntely (nvidiaintely):

oh lol. Can you guess my age?

OpenStudy (frostbite):

Difficult actually guessing. 16-17 maybe?

NvidiaIntely (nvidiaintely):

Nope, 13.

NvidiaIntely (nvidiaintely):

And you?

OpenStudy (frostbite):

23. :P

NvidiaIntely (nvidiaintely):

Oh :P

NvidiaIntely (nvidiaintely):

I have some interesting videos coming out next month so you wanna subscribe xD?

OpenStudy (frostbite):

But it looks good. Got some good stuff going, keep it up. The biggest issue with this is just the money :)

NvidiaIntely (nvidiaintely):

Yeah, but I already got some computer companies emailing me about free products they will send me lol, so maybe not.........

NvidiaIntely (nvidiaintely):

The RX 480 I am getting is free xD

OpenStudy (frostbite):

That is really good. I was gonna say if you get some sponsors then this could become big fast. So nice especially for your age! :)

OpenStudy (frostbite):

my first grant I first got this year.

OpenStudy (frostbite):

But it was also a huge one.

NvidiaIntely (nvidiaintely):

What was huge?

OpenStudy (frostbite):

My grant proposal I sent to Nvidia and the scientific council where I live. I requested the computer I told you about.

NvidiaIntely (nvidiaintely):

oh okay. Also OriginPC is my one and only sponsor right now lol.

NvidiaIntely (nvidiaintely):

I gtg now, hope to talk again! cya later!

OpenStudy (frostbite):

Have a good evening, and I will differently talk to you again now that I follow your channel.

NvidiaIntely (nvidiaintely):

Thanks lol! Maybe through email or youtube next time! cya!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!