10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a large file and many lines are duplicated. I'm trying to delete lines with every second occurrence of a pattern. Did tried searching similar question but no luck.
I can delete all lines matching pattern with :g/pattern/d but don't want to lose data.
Sample pattern to delete... (6 Replies)
Discussion started by: homer4all
6 Replies
2. Shell Programming and Scripting
Hi,
I have a simple problem but i guess stupid enough to figure it out. i have thousands rows of data. and i need to find match patterns of two columns and print the number of rows. for example:
inputfile
abd abp 123
abc abc 325
ndc ndc 451
mjk lkj... (3 Replies)
Discussion started by: redse171
3 Replies
3. Linux
Hi
I have to replace a pattern found in the first uncommented line in a file. The challenge I'm facing is there are several such similar lines but I have to edit only the first uncommented line.
Eg:
#this is example
#/root/xyz:Old_Pattern
/root/xyz:Old_Pattern
/root/xyz:Old_Pattern
... (10 Replies)
Discussion started by: Stoner008
10 Replies
4. UNIX for Dummies Questions & Answers
Hi
I want to search for a specific pattern in file
Say
ABC;HELLO_UNIX_WORLD;PQR
ABC;HELLO_UNIX_WORLD_IS_NOT_ENOUGH;XYZ
ABC;HELLO_UNIX_FORUM;LMN
Pattern to search is : "HELLO_UNIX_*****" and not "HELLO_UNIX_***_***_"
I mean after "HELLO_UNIX" there can only be one word.In this case... (2 Replies)
Discussion started by: dashing201
2 Replies
5. Shell Programming and Scripting
Hi friends, I want to search for some hex error codes in some files.
After the hex error code is found, the occurences would be counted.
Afterwards the found hex errorcode would be cat into a separate file.
Here is my code:
#!/usr/bin/perl
use File::Basename;
my $find = $ARGV;
my... (2 Replies)
Discussion started by: sdohn
2 Replies
6. Shell Programming and Scripting
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies
7. Shell Programming and Scripting
Hi
i want to search two pattern on same line and replace onther pattern..
INPut file
aaaa bbbbb nnnnnn ttttt
cccc bbbbb nnnnnn ppppp
dddd ccccc nnnnnn ttttt
ffff bbbbb oooooo ttttt
now i want replace this matrix like.. i want search for "bbbbb","nnnnnn" and search and replace for... (4 Replies)
Discussion started by: nitindreamz
4 Replies
8. Shell Programming and Scripting
I have an array as follows:
Space: ABC
Name: def
Age: 22
Type: new
Name: fgh
Age: 34
Type: old
Space: XYZ
Name: pqr
Age: 44
Type: new
:
:
How can I separate the array with elements starting from Space:ABC until Space: XYZ & put them in a different array & so on... (4 Replies)
Discussion started by: deo_kaustubh
4 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I think you ppl did not get my question correctly, let me explain
I have 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
... (1 Reply)
Discussion started by: imas
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I am new to this forum and i would like to get help in this issue.
I have a file 1.txt as shown:
apple
banana
orange
apple
grapes
banana
orange
grapes
orange
....
Now i would like to search for pattern say apple or orange and then put a # at the beginning of the pattern... (2 Replies)
Discussion started by: imas
2 Replies