Sponsored Content
Homework and Emergencies Homework & Coursework Questions Help with using different types of GREP Post 302576622 by SilvarHawke on Friday 25th of November 2011 10:44:27 AM
Old 11-25-2011
Well if its alright then I may as well as them. I'm curently working through the same worksheet only I have moved onto advanced grep, and there are two questions in it that have me puzzled. Here they are.

Quote:
j) Find out which models of car do NOT contain a digit within their name. Where (line position) within the file are the cars which do have digits within their model name?

m) Find any car model names which include “ee”, without explicitly including “ee”
within your search pattern. Hint: Use curly { } brackets

n) Find out all car models beginning with “B”, and redirect these to a file called
“alpha-carslist.txt”. Append to this file, all car models beginning with “C”. How
many records are in the above file? (Hint: use the “wc -l” command)
And just to show you the layout of how the car list looks like, here are the first few lines, not all of them just in case it seems like too much.

Quote:
Ford:Mondeo:1997:Blue:5
Vauxhall:Vectra:1999:White:2
Seat:Ibiza:1996:Red:4
Peugeot:406:1999:Silver:1
McLaren:F1:1997:Black:2
Skoda:Octavia:2003:Silver:2
Peugeot:206:2000:Red:1
Even with the hints for m & n I'm still having trouble with what comands I should be using, all I know is that I have been using a format such as this for the most recent questions and answers.

Quote:
cat carslist.txt | grep '.*:.*:.*:.*:.*$'
or something similar anyway. Some more help on these would be greatfully appreciated. =-)
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

backup types

can anyone explain me difference between tar and ufsdump commands.............and also i wd like to know the difference between incremental and differential backup......... thx in advance (1 Reply)
Discussion started by: girish_shukla
1 Replies

2. UNIX for Dummies Questions & Answers

Two types of pipes?

What is the difference between: cd /tmp tar -cf - *.txt |gzip > tmp_txt.tar.gz and cd /tmp mknod pipe p gzip < pipe > /tmp/tmp_txt1.tar.gz & tar -cf pipe *.txt Apart from the fact that we have to create the pipe file manually, is there any difference in the performance of the two?... (5 Replies)
Discussion started by: blowtorch
5 Replies

3. UNIX for Dummies Questions & Answers

mime types

Hi, I am trying to launch an ogg movie from a pdf file which has been produced with pdflatex and \movie {\centerline{\includegraphics {grafiques_xerrades/un_manolo_amb_camera.pdf}}} {hlims_xerrades/XocCumuls.ogg} The switch "externalviewer" makes kpdf launch the default... (5 Replies)
Discussion started by: pau
5 Replies

4. UNIX for Dummies Questions & Answers

How do I grep in specific file types?

I have a directory with file types ending .log, .mml, .gll, .dll . How can I grep expressions only in say the .log files? (3 Replies)
Discussion started by: bbbngowc
3 Replies

5. Programming

enumeration types in C

If I want to declare an array of structures in C and have the number of items in that array to correspond to the items of an enumeration, is there a way to access the maximum value in the enumeration when declaring the array? For instance: typedef struct { various fields.... } ... (3 Replies)
Discussion started by: cleopard
3 Replies

6. What is on Your Mind?

What Types of Food Do You Like The Most?

On another simple topic, multiple choice answers OK ( you can pick more than one or suggest others - we will add your suggestions to the poll ). What Types of Food Do You Like The Most? (27 Replies)
Discussion started by: Neo
27 Replies

7. Shell Programming and Scripting

Cp -r except certain file types

the following excludes certain directories successfully cp -r probe/!(dir) /destination I want to exclude certain file types and tried unsuccessfully cp -r probe/!(*.avi) /destination (2 Replies)
Discussion started by: tmf
2 Replies

8. UNIX for Advanced & Expert Users

Recursive grep with only certain types of files

Can I please have some ideas on how to do a recursive grep with certain types of files? The file types I want to use are *.c and *.java. I know this normally works with all files. grep -riI 'scanner' /home/bob/ 2>/dev/null Just not sure how to get it to work *.c and *.java files. (5 Replies)
Discussion started by: cokedude
5 Replies
car(1)								   GNU Telephony							    car(1)

NAME
car - crytographic archiver. SYNOPSIS
car [options] [paths...] car --decode [.carfile] DESCRIPTION
Creates and decodes portable cross-platform crytographic archives. An archive can be a collection of files, or an in-stream message that is piped. Output can be to a binary .car file, or ascified text. A symetric cipher is used, and the passhrase is hashed to form a key. OPTIONS
--cipher=name Specify symetric cipher. By default 256 bit aes is used. --decrypt Specify decryption operation on an existing car stream or file. If no file is specified, stdin is used. --digest=name Specify name of digest algorithm. By default sha will be used. --follow Dereference and follow symlinks. Otherwise they are ignored. --output=filename Specify output file for a new archive. By default stdout is used. --overwrite Always overwrite existing files without prompting. --quiet Non-interactive and no status output. --recursive If argument is a directory, recursively scan directory and any subdirectory contents as arguments. --help Outputs help screen for the user. AUTHOR
car was written by David Sugar <dyfet@gnutelephony.org>. REPORTING BUGS
Report bugs to bug-commoncpp@gnu.org. COPYRIGHT
Copyright (C) 2010 David Sugar, Tycho Softworks. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. GNU uCommon January 2010 car(1)
All times are GMT -4. The time now is 10:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy