Hi,
I'm new to programming. I've written some scripts in awk and want to make a batch file or program to run these scripts reading one file and naming new files depending on the scripts that were used.
These are 2 examples of different scripts I'm using.
awk '{if($2 == 64 || $2 ==128){print $0}}' filein.sam > fileout64or129.sam
awk '{if($2 == 65 || $2 ==129){print $0}}' filein.sam > fileout65or129.sam
This is the file I made today and it is running one the awk script (I can see it in top), but doesn't seem to create a file I can find. (This file doesn't include the second awk script, I seem to have a problem naming the files rather than running the program or awk commands)
echo Enter file name
read NAME
awk '{if($2 == 65 || $2 ==129){print $0}}' $NAME > $NAME65or129.sam
What I would like to do is be able to type in the name of the file (filein.sam), have it run both scripts and name the output files fileout64or129.sam, fileout65or129.sam, or fileout(some flag).sam.
Thanks
I'm new to programming. I've written some scripts in awk and want to make a batch file or program to run these scripts reading one file and naming new files depending on the scripts that were used.
These are 2 examples of different scripts I'm using.
awk '{if($2 == 64 || $2 ==128){print $0}}' filein.sam > fileout64or129.sam
awk '{if($2 == 65 || $2 ==129){print $0}}' filein.sam > fileout65or129.sam
This is the file I made today and it is running one the awk script (I can see it in top), but doesn't seem to create a file I can find. (This file doesn't include the second awk script, I seem to have a problem naming the files rather than running the program or awk commands)
echo Enter file name
read NAME
awk '{if($2 == 65 || $2 ==129){print $0}}' $NAME > $NAME65or129.sam
What I would like to do is be able to type in the name of the file (filein.sam), have it run both scripts and name the output files fileout64or129.sam, fileout65or129.sam, or fileout(some flag).sam.
Thanks