10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I am looking for to filter out based on 7th character and list the number of occurrence based on the 7th character if p , d , o or m
1. if 7th character is p , Output should be: p_hosts = N
2. if 7th character is d , Output should be: d_hosts = N
3. if 7th character is o , Output... (10 Replies)
Discussion started by: rveri
10 Replies
2. Shell Programming and Scripting
Hello,
Here is my text data excerpted from the webpage:
input
My target is to get:
What i tried is:
sed 's/.*\(connector\)/1/' input > output
but all characters coming before the word "connector" are deleted which is not good for me.
My question: (9 Replies)
Discussion started by: baris35
9 Replies
3. UNIX for Dummies Questions & Answers
How to find count total number of pattern in a file …
File contains : a.txt
-------------
aaa bbb nnn
ccc aaa bbb
aaa ddd aaa
aaa aaa aaa
grep -c aaa a.txt
Op: 4 ( But my requirement is should count the total no of patterns as 7 ) (4 Replies)
Discussion started by: Jitten
4 Replies
4. Shell Programming and Scripting
Hi,
I am trying to use forward slash in awk. While running the command through console, its working fine but not working while running it through shell script.
find . -name "*" -ctime -6 | xargs cat | grep -E -v ^fileName\|^\(\) | awk -v DATE="${CURR_DATE}" -v DATE_LOG="$DATE_SYS" '
... (4 Replies)
Discussion started by: abhi1988sri
4 Replies
5. Shell Programming and Scripting
Hi,
I have a requirement to search for a pattern in each line in a file and remove the in between words till the 3rd occurrence of double quote (").
Ex: CREATE TABLE "SCHEMANAME"."AMS_LTV_STATUS"
(Note: "SCHEMANAME" may changes for different schemas. Its not a fixed value)
I need to... (2 Replies)
Discussion started by: satyaatcgi
2 Replies
6. UNIX for Advanced & Expert Users
Hi,
I want to add below line after end of a file (i.e file1)
&&echo "copy done" >> out.txt
cat file1
scp user1@server1:/tmp/dir /tmp/dir1
my requirment is
cat file1
scp user1@server1:/tmp/dir /tmp/dir1 &&echo "copy done" >> out.txt
could any one please help me (7 Replies)
Discussion started by: anshu ranjan
7 Replies
7. Shell Programming and Scripting
Hello ,
i have a text file like this :
A123 c12AB c32DD aaaa
B123 23DS 12QW bbbb
C123 2GR 3RG cccccc
i want to remove the numbers from second and third column only.
i tried this :
perl -pe 's///g' file.txt > newfile.txt
but it will remove the number from... (7 Replies)
Discussion started by: shelladdict
7 Replies
8. UNIX for Dummies Questions & Answers
I'm new to scripting and would appreciate any help.
I have a list of over 20 words in File1 that I need to find in columns 10-15 of File2. I need the entire row of File2 that the File1 list matches.
I originally used a grep command which works, but provides File1 results that can be found... (3 Replies)
Discussion started by: Chillin
3 Replies
9. Ubuntu
Hi;
I've been searching posts to find a solution to what I'm trying to do, but I've have NOT found anything yet.
I have a file (file1) with 300K columns and 1411 rows, the columns don't have a column no. header (No header at all) and I'm trying to fetch the information from specific columns.... (3 Replies)
Discussion started by: sogi
3 Replies
10. Shell Programming and Scripting
Here is my file name countries
USSR 8650 262 Asia
Canada 3852 24 North America
China 3692 866 Asia
USA 3615 219 North America
Brazil 3286 116 South America
India 1269 637 Asia
Argentina 1072 ... (8 Replies)
Discussion started by: ironhead3fan
8 Replies