ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi Friends,
I need your help.
I'm working on script, in which I'm trying to filter the values & displaying the output on screen as well as sending the output in a csv file.
Suppose I have values like:-
Input file has following file
I think you will need to structure your question better if you want help.
Firstly, in what shell is the following working for you:
Code:
print "%s%s%s%s\n" "X1" "X2" "X3" "X4" > output
Also, if just printing the XN field names, why would you need such an elaborate print statement?
Second, how does the bracing structure you have used in the below work??
Code:
grep -w "C" {Input_file}.csv >> output
Lastly, I fail to see how the above is displaying to stdout (on screen) as well as into the output file?
Again this would have to be redirection in a shell I am not familiar with and that works in a way no other shell does (that i know of).
My mistake again, actually, I'm using output file, which is also storing it in temp folder. So, it is storing as ${output}.csv, where output file name randomly generate.
His should work too though. I think the problem lies elsewhere in the script. It would help if the OP just copied and pasted his ACTUAL script into the post, instead of the pseudocode he's typing out which appear to be full of typos.
Last edited by suicidaleggroll; 10-03-2012 at 01:01 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.