10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the f1 file below I am trying to clean it up removing lines the have _tn_ in them. Next, removing the characters in $2 before the ninth /. Then I remove the ID_(digit- always 4). Finally, the charcters after and including the first _. It is curently doing most of it but the cut is removing $1... (5 Replies)
Discussion started by: cmccabe
5 Replies
2. Shell Programming and Scripting
Field1=””
Field2=””
Field3=””
Field4=””
Field5=””
USER INPUT UP TO 5 FIELDS
awk -F , '{ if ( $3 == Field1 && $6 == Field2 && $8 == Field3 && $9 == Field4 && $10 == Field5) print $0 }' /tmp/rodney.outD
INPUT FILE (Rodney.outD):
... (3 Replies)
Discussion started by: rmerrird
3 Replies
3. Shell Programming and Scripting
In the below I am trying to use awk to match all the $13 values in input, which is tab-delimited,
that are in $1 of gene which is just a single column of text.
However only the line with the greatest $9 value in input needs to be printed.
So in the example below all the MECP2 and LTBP1... (0 Replies)
Discussion started by: cmccabe
0 Replies
4. Shell Programming and Scripting
Hi All,
I am trying to read a file character by character,
#!/bin/bash
while read -n1 char; do
echo -e "$char\c"
done < /home/shak/testprogram/words
Newyork is a very good city.
Newyorkisaverygoodcityforliving
I need to preserve the spaces as thats an... (3 Replies)
Discussion started by: Kingcobra
3 Replies
5. Shell Programming and Scripting
Given a file:
# configuration file for newsyslog
# $FreeBSD: /repoman/r/ncvs/src/etc/newsyslog.conf,v 1.50 2005/03/02 00:40:55 brooks Exp $
#
# Entries which do not specify the '/pid_file' field will cause the
# syslogd process to be signalled when that log file is rotated. This
# action... (10 Replies)
Discussion started by: jnojr
10 Replies
6. Shell Programming and Scripting
This seems to be a stupid basic question, but I cant get the space to stick in the awk variable.
I do use this command to grep a time range of the log file.
cat /var/log/daemon.log | awk '$0>=from&&$0<=to' from="$(date +%b" "%e" "%H:%M:%S -d -24hour)" to="$(date +%b" "%e" "%H:%M:%S)"
I now... (9 Replies)
Discussion started by: Jotne
9 Replies
7. Shell Programming and Scripting
Hi,
Does any one know how to avoid the scenario where awk ignores the fields having only spaces or empty fields?
for instance,
Data: "a","b","c","d",""," "
code:
awk -F, '{ print NF }' File
the output I get is 4 instead of 6 do you know how to avoid this? (6 Replies)
Discussion started by: ahmedwaseem2000
6 Replies
8. Shell Programming and Scripting
Preserve byte size of fields while pasting it to other file
Hello
I want to set two fields in a text file to be of size 20.
how to do it using unix ?
eg: ABC.txt
Name | City
I want Name and City both to be of size 20.
Also If I am pasting it in other file the byte size should be... (1 Reply)
Discussion started by: dashing201
1 Replies
9. UNIX for Dummies Questions & Answers
Hello
I want to set two fields in a text file to be of size 20.
how to do it using unix ?
eg: ABC.txt
Name | City
I want Name and City both to be of size 20.
Also If I am pasting it in other file the byte size should be preserved.i.e. If I want to append content of ABC.txt to other... (0 Replies)
Discussion started by: dashing201
0 Replies
10. UNIX for Dummies Questions & Answers
This is what I need to do
I have a file that has a field with values like this
1111 2222
3333 4444
55555 666
333333333
444444444
I need for my command to out put only those fields that do not have spaces in them. So my output for the above file would be
333333333
444444444
how... (10 Replies)
Discussion started by: alfredo123
10 Replies