grouping and sorting??

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers grouping and sorting??
# 1  
Old 10-01-2009
grouping and sorting??

how would I write a command line that creates a new file named stuff.txt in the current working directory which contains the number of directories in the current working directory, followed by the number of empty files in the current working directory, followed by the name of the working directory?
# 2  
Old 10-01-2009
What did you try so far? Sounds like homework btw.
# 3  
Old 10-01-2009
It was a question in class I don't even know where to start
# 4  
Old 10-01-2009
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grouping and counting

Hello, I would like to group/sort a file of records by a particular field and then count how many records belong in that grouping. For example say I have the following data: 1234|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA ABCD|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA EFGH|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|BB... (14 Replies)
Discussion started by: Nik44
14 Replies

2. Shell Programming and Scripting

Grouping and Calculating

Hi All, I want to read the input file and store the output in the Output file. I pasted the sample Input and Output file below. Help me with this. Input file ================================= ITEM1 AAAAA 1 ITEM1 BBBBB 1 ITEM1 CCCCC 1 ITEM2 AAAAA 5 ITEM2 CCCCC 4... (1 Reply)
Discussion started by: humaemo
1 Replies

3. Shell Programming and Scripting

Name grouping

awk 'FNR==NR {a; next} $NF in a' genes.txt refseq_exons.txt > output.txt I can not figure out how to group the same name in $4 together. Basically, all the SKI together in separate rows and all the TGFB2. Thank you :). chr1 2160133 2161174 SKI chr1 218518675 218520389 TGFB2... (1 Reply)
Discussion started by: cmccabe
1 Replies

4. Shell Programming and Scripting

UNIX grouping

Hi guys, I am a complete newbie to unix and have been tasked with creating a script to group the following data (file) by hourly slots so that I can count the transactions completed within the peak hour. I am not sure how to group data like this in unix. Can anyone please help? Here is an... (1 Reply)
Discussion started by: MrMidas
1 Replies

5. Shell Programming and Scripting


Hi all, I am using following command: perl input.txt output.txt CUTOFF 3 > groups_3.txt containing, two files (input.txt, output.txt) and getting output in groups_3.txt: But, I wish to have 30 files corresponding to each CUTOFF ranging from 0 to 30 using the same... (1 Reply)
Discussion started by: bioinfo
1 Replies

6. Shell Programming and Scripting

Selective grouping

I have a text file in this format. Group: AAA Notes: IP : #User xxxxxxxxx #Password aaaaaaaaaaaaaaaa Group: AAA Notes: IP : #User yyyyyyyyyyyyy #Password bbbbbbbbbbbbb (8 Replies)
Discussion started by: anil510
8 Replies

7. UNIX for Advanced & Expert Users

grouping lines

Hi all, I have input lines like below: A;100;Paris;City;10;0;0 A;100;Paris;City;0;10;0 A;100;Paris;City in Europe;0;0;20 B;101;London;City;20;0;0 B;101;London;City;0;20;0 B;101;London;City in Europe;0;0;40 I need to group the above lines to: A;100;Paris;City in Europe;10;10;20... (4 Replies)
Discussion started by: andy2000
4 Replies

8. UNIX for Dummies Questions & Answers

Help with data grouping

Hi all, I have a set data as shown below, and i would like to eliminate the name that no children - boy and girl. What is the appropriate command can i use(other than grep)? Please assist... My input: name sex marital status children - boy children - girl ... (3 Replies)
Discussion started by: 793589
3 Replies

9. UNIX for Advanced & Expert Users

Regarding the user grouping

I am new to the unix server. My question is: i have 10 users a b c d e f g h i j Among the 10 5 users are (normal) user and remainging 5 users are (qad) users How can i sepearte this one? How can i give the dlc access rights? Please provide the clear cut idea. (0 Replies)
Discussion started by: kingganesh04
0 Replies

10. Shell Programming and Scripting

egrep and grouping

i am using the c shell on solaris. directories i'm working with: ls -1d DIV* DIV_dental/ DIV_ibc/ DIV_ifc/ DIV_index/ DIV_pharm/ DIV_sectionI/ DIV_sectionI-title/ DIV_sectionI-toc/ DIV_sectionII-title/ DIV_sectionII-toc/ DIV_standing/ DIV_standing-toc/ DIV_title/ DIV_vision/ (1 Reply)
Discussion started by: effigy
1 Replies
Login or Register to Ask a Question