10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Folks,
I have a file with fields as follows which has last field in multiple lines. I would like to combine a line which has three fields with single field line for as shown in expected output. Please help.
INPUT
hname01 windows appnamec1eda_p1, ... (5 Replies)
Discussion started by: shunya
5 Replies
2. Shell Programming and Scripting
Hi,
Need to replace last field in a file(/etc/passwd) ,if first filed matches with particular username.
Scenario:
cat testfor1
deekshi:x:7082:7082::/home/deekshi:/bin/bash
harini1:x:7083:7083::/home/harini1:/bin/bash
Here,if first field contains "deekshi", then i should replace... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
3. Shell Programming and Scripting
I am trying to remove lines in the target.txt file if $5 before the - in that file matches sorted_list. I have tried grep and awk. Thank you :).
grep
grep -v -F -f targets.bed sort_list
grep -vFf sort_list targets
awk
awk -F, '
> FILENAME == ARGV {to_remove=1; next}
> ! ($5 in... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
Hi,
I am trying with the below Perl command to print the first field when the second field matches the given pattern:
perl -lane 'open F, "< myfile"; for $i (<F>) {chomp $i; if ($F =~ /patt$/) {my $f = (split(" ", $i)); print "$f";}} close F' dummy_file
I know I can achieve the same with the... (7 Replies)
Discussion started by: royalibrahim
7 Replies
5. UNIX for Dummies Questions & Answers
hi
i have a file with the following lines
2303:13593:137135 16 abc1 26213806.......
1234:45675:123456 16 bbc1 9813806.......
2303:13593:137135 17 bna1 26566444....
1234:45675:123456 18 nnb1 98123456.......
i want to join the lines having common 1st field i,e.,
... (1 Reply)
Discussion started by: anurupa777
1 Replies
6. Shell Programming and Scripting
hi
i have file as below , i want to add duplicate records like bell_bb to one record with valuve as 15 ( addition of both )
any oneline awk script to achive this ?
header 0
CAMPAIGN_NAME 1
Bell_BB 14
Bell_MONTHLY 803
SOLO_UNBEATABLE 644
Bell_BB 1
Bell_MONTHLY 25
SOLO_UNBEATABLE... (4 Replies)
Discussion started by: raghavendra.cse
4 Replies
7. UNIX for Dummies Questions & Answers
sir... am having a data file of customer master., containing some important fields as a set one line after another.,
what i want is to have one set of these fields(rows) one after another in line.........then the second set... and so on... till the last set completed.
I WANT THE DATA... (0 Replies)
Discussion started by: KANNI786
0 Replies
8. UNIX for Dummies Questions & Answers
sir... am having a data file of customer master., containing some important fields as a set one line after another.,
what i want is to have one set of these fields(rows) one after another in line.........then the second set... and so on... till the last set completed.
... (0 Replies)
Discussion started by: KANNI786
0 Replies
9. Shell Programming and Scripting
Howdy.
I know this is most likely possible using sed or awk or grep, most likely a combination of them together, but how would one go about running a grep like command on a file where you only try to match your pattern to the second field in a line, space delimited?
Example:
You are... (3 Replies)
Discussion started by: LordJezoX
3 Replies
10. Shell Programming and Scripting
I am trying to join/paste columns from two files for the rows with matching first field. Any help will be appreciated.
Files can not be sorted and may not have all rows in both files.
Thanks.
File1
aaa 111
bbb 222
ccc 333
File2
aaa sss mmmm
ccc kkkk llll
ddd xxx yyy
Want to... (1 Reply)
Discussion started by: sk_sd
1 Replies