10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
so, i want to tail about the last 3000 lines of a log file and find the column that has the same number of characters across all 3000 lines (or most of the 3000 lines)
tail -3000 logfile | while read line
do
ColumnCharCount=$(for eachwordorwhatever in "${echo $line}"
do
... (8 Replies)
Discussion started by: SkySmart
8 Replies
2. Shell Programming and Scripting
hi,
i have a fixed width file with multiple columns and need to print data using awk command.
i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file.
but now i have a fixed width file like below:
7518 8269511BH 20141224951050N8262
11148 8269511BH... (5 Replies)
Discussion started by: kcdg859
5 Replies
3. Shell Programming and Scripting
Hi All,
I have a file testarun.txt contains the below lines and i want to print the lines if the character positions 7-8 matches 01.
201401011111
201401022222
201402013333
201402024444
201403015555
201403026666
201404017777
201404028888
201405019999
201405020000
I am trying the... (4 Replies)
Discussion started by: Arunprasad
4 Replies
4. Shell Programming and Scripting
Hi,
I am in a situation to print the message on a column, where the each line starting position should be same.
For example code:
HOSTNAME1="1.2.3.4.5.6.7"
TARGET_DIR="/tmp"
echo "HOSTNAME1:" "$HOSTNAME1" | awk -v var="Everyone" '{len=55-length;printf("%s%*s\n",$0,len,var)}'
echo... (4 Replies)
Discussion started by: tprabhaker
4 Replies
5. Shell Programming and Scripting
Hello Everyone,
I'm running AIX 5.3 and need to generate a 100 character fixed length empty file from within a bash script that I am developing.
I searched and was able to find:
dd if=/dev/zero of=/test/path/file count=100
however my understanding is that this will generate a file of a... (10 Replies)
Discussion started by: jvt
10 Replies
6. Shell Programming and Scripting
Hi,
I have a fixed length file where I need to verify the values of 3 different fields, where each field will have a different value.
How can I do that in a single step. (6 Replies)
Discussion started by: naveen_sangam
6 Replies
7. UNIX for Dummies Questions & Answers
Hi, all.
I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file:
10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783
19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657
And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies
8. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
9. Shell Programming and Scripting
Problem:
entry_name="joke:hello:yellow:blue:default"
print("%d %-12s\t%-10s\t%-5s\n", $i, $entry_name....);
I just want to print the output like this
index entry value ....
1 joke:hello:y 0 123 567
ellow:blue:d
... (1 Reply)
Discussion started by: a2156z
1 Replies
10. Shell Programming and Scripting
Hi, I have two input files.
File1:
ID Name Place
1-234~name1~Newyork
1-34~name2~Boston
1-2345~name3~Hungary
File1 is a variable length file where each column is seperated by delimitter "~".
File2:
ID Country
1-34<<11 SPACES>>USA<<7 spaces>>
1-234<<10 SPACES>>UK<<8... (5 Replies)
Discussion started by: manneni prakash
5 Replies