09-05-2011
Quote:
Originally Posted by
nick2011
No substring match, just exact line by line match
Quote:
Originally Posted by
apmcd47
Take your pick:
PHP Code:
fgrep -v -f L2 L1 > L3
fgrep -v -f L2 < L1 > L3
Your suggestions aren't quite correct. You need to use -x to ensure that substrings do not match, only entire lines.
Regards,
Alister
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to access exact line in a file (sh script)
for example I have a variable input and I want to access input.th line in file. for example line 5 or 7. (2 Replies)
Discussion started by: walnut
2 Replies
2. UNIX for Dummies Questions & Answers
It seems like it should be very simple to have a command like grep return a specific line from a file but I can't find anything in the man pages to make grep search by line. I've looked in cat as well. Anyone know how to return a single line from a file? (5 Replies)
Discussion started by: gelitini
5 Replies
3. Shell Programming and Scripting
I have my data something like this
SERIAL FIRSTOCCURRENCE
NETPROTOCOL
1947430693 07/01/2009 05:16:40
FR
SERIAL FIRSTOCCURRENCE
NETPROTOCOL
1947430746 07/01/2009 05:18:05
FR
I want the output as follows.... (1 Reply)
Discussion started by: rdhanek
1 Replies
4. Shell Programming and Scripting
How do I filter only comments and still keep Line breaks at the end of the line!?
This is one of the common tasks we all do,, How can we do this in a right way..!?
I try to ignore empty lines and commented lines using following approach.
test.sh
# \040 --> SPACE character octal... (17 Replies)
Discussion started by: kchinnam
17 Replies
5. Shell Programming and Scripting
Hello All,
What i am doing is , i tail a file from certain chatacter and then cat -n to get the line numbers.I search for a particular string and gets it line number. What i am interested in is the next line immediately after the pattern i search.
But grep gives me result for all line... (5 Replies)
Discussion started by: kailash19
5 Replies
6. Shell Programming and Scripting
dear all
about my last question
in fileA.txt (all list line i want to find in fileB.txt)
is content of line number
fileA.txt
23
34
35
55
59
and fileB.txt is content like
24:asd|ekkk|001|001
123:bca|egsd|210|002
1231:cas|egds|322|231
...
in fileB.txt they have line number like... (5 Replies)
Discussion started by: zvtral
5 Replies
7. UNIX for Advanced & Expert Users
Hello All,
I have following line and text file
line =08 * * 3 /data/reports/bin/xyz.ksh -o customreports.com -f abc.sql -m xyz.com -c -g
file:- abc.crontab
08 * * 3 /data/reports/bin/xyz.ksh -o customreports.com -f abc.sql -m xyz.com -c -g
06 * * 3 /data/reports/bin/xyz.ksh -o... (3 Replies)
Discussion started by: anyera
3 Replies
8. Shell Programming and Scripting
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies
9. Shell Programming and Scripting
Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files.
$path="/mnt/windows/path"
echo 'recording names'
cd "$path"
for names in $path
than Im stuck on... (2 Replies)
Discussion started by: graphicsman
2 Replies
10. Shell Programming and Scripting
I have one big XML file which contains information about 100 jobs,"JOB JOBISN=" indicates that is a job so where ever tag starts with "JOB JOBISN=" then i need to add below highlighted line between
"<INCOND NAME" and "<OUTCOND NAME" for all jobs.like this i want to add below highlighted line for... (7 Replies)
Discussion started by: katakamvivek
7 Replies