Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have a directory called "Month" which has 12 files named on months.
/home/months> touch Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
I need to display the list of file from Jan to Jun (using sed or grep)?
2. Relevant commands, code, scripts, algorithms:
NA
3. The attempts at a solution (include all code and scripts):
NA
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Amity,Noida,India, Sanjeev Thakur, MCA
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Well, why don't you create an environmental variable with the contents "Jan Feb ... Dec". That will make your life much easier.
Then you can play with "cut" command. You can set the field range of 1-6, be sure to define the delimiter to space (quote it) and if you need the contents of the files, backquote them to a cat command.
That's fast and dirty.
If you need something more elaborate, consider using an interpreted language that supports hash tables (dictionaries) like perl or python.
Something like
{'Jan':1, 'Feb':2, ... 'Dec':12 }
And sort it by value.
Hi All,
I need to recursively grep several folders for a MAC address and display the results with the date of the file name at the start. Even better would be if the final results were displayed chronologically so the newest file is always at the end. Oldest at the top, regardless of what... (8 Replies)
I am new to shell scripting plz help me to get solution for below requirement -
If name.sh file is present, message will be displayed as “name.sh is present” else "name.sh is not present"
I have tested below script but getting error.
#!/bin/ksh
file_found=`ls name.sh`
found=`echo $?`
if... (6 Replies)
How to add these all ( 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25) in the script and How to calculate the GPA?? :wall:
For example a course record file can be like this:
COURSE NAME: Operating Systems
CREDITS: 4
123456 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25
243567 0 1 1 0 1 1 0 1 0 0 0 7 9 12 15 17 15... (1 Reply)
How to add these all ( 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25) in the script and How to calculate the GPA?? :wall:
For example a course record file can be like this:
COURSE NAME: Operating Systems
CREDITS: 4
123456 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25
243567 0 1 1 0 1 1 0 1 0 0 0 7 9 12 15 17 15... (1 Reply)
*****************************************
Right now i have this current system.
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which... (7 Replies)
Hi,
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
I am making a program in c. I want the progrm to be able to display file names ( like in unix we do long lisiting)
what should i do?
Any help will be appreciated (3 Replies)
I have a file xx like this
abc
abcd
abc
abcd
abcd
efgh
ijkl
mnop qrst
uv wxyz
Now I want to search for "abcd". After the last found, it will display the remaining of the file. So here I am expecting something like
abcd
efgh
ijkl
mnop qrst
uv wxyz (5 Replies)
I have a file xx like this
abc
abcd
abc
abcd
abcd
efgh
ijkl
mnop qrst
uv wxyz
Now I want to search for "abcd". After the last found, it will display the remaining of the file. So here I am expecting something like
abcd
efgh
ijkl
mnop qrst
uv wxyz (2 Replies)