10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need the use sed or AWK using cat the file
Node1
TDEV RW 1035788
TDEV RW 1035788
Server1
TDEV RW 69053
Server2
TDEV RW 69053
TDEV RW 103579
Server3
TDEV RW 69053
server4
RDF1+TDEV RW 69053
RDF1+TDEV RW 517894
RDF1+TDEV RW 621473
server6
TDEV RW 34526
TDEV RW 34526 (22 Replies)
Discussion started by: ranjancom2000
22 Replies
2. UNIX for Dummies Questions & Answers
Hello
Im new treat me nicely, I have a headache :)
I have a script that seemed to work now it doesnt anyway, the last part is adding counts of unique items in a csv file eg
05492U34 38
05492U34 47
two columns, (many different values like this in file)
i want... (7 Replies)
Discussion started by: aniquebmx
7 Replies
3. Shell Programming and Scripting
Hi everyone!
I sometimes need to do some simple arithmetics, like adding a number to a certain column of a file. So I wrote a small function in the .bashrc file, which looks like this
shifter()
{
COL=$1
VAL=$2
FILE=$3
cp $FILE $FILE.shifted
awk 'NF==4 {$(( $COL )) = $(( $COL ))... (6 Replies)
Discussion started by: radudownload
6 Replies
4. Shell Programming and Scripting
75
103
131
133
138
183
197
221
232
234
248
256
286
342
368
389
463
499
524
538 (5 Replies)
Discussion started by: chrisjorg
5 Replies
5. UNIX for Dummies Questions & Answers
Hi ,
Can any one please tell me, how can we add the file name as column using sed.
right now we are using the below awk command for adding the file name as column but when we are calling this script from datastage it is deleting the file data..very weird raised a support ticket with datastage.... (2 Replies)
Discussion started by: mora
2 Replies
6. Shell Programming and Scripting
Hi,
test.txt contains below values
1
2
3
4
5
Desired output:
'TT.1',
'TT.2',
'TT.3',
'TT.4',
'TT.5'
Last value should not contain the comma after the value. Below is the script which i have tried. I'm using Linux.
#!/bin/bash
for i in $test.txt (4 Replies)
Discussion started by: venkatesht
4 Replies
7. Shell Programming and Scripting
Hello everyone,
I have a file with the following structure:
abc xyz 111 222
agf hjhf 787 799
tht yah 878 898
... ... ... ...
... ... ... ...
... ... ... ...
I want to add a column (with a fixed value of 1000) at the end such that it becomes:
abc xyz 111 222 1000
agf hjhf 787... (5 Replies)
Discussion started by: ad23
5 Replies
8. UNIX for Dummies Questions & Answers
Is there anyway to use awk to add a first column to my data that automatically goes from 1 to n , where n is the numbers of my rows?:confused: (4 Replies)
Discussion started by: cosmologist
4 Replies
9. Shell Programming and Scripting
I have a txt file as follows
Code:
Oct 1 file1 4144
Oct 1 file23 5170
Oct 2 file5 3434
Oct 21 file56 2343
I need to add a new column by marking the right log file from current directory. For example populate like this. Please not in the second columt for "1" it has... (2 Replies)
Discussion started by: gubbu
2 Replies
10. Shell Programming and Scripting
Hello Friends,
i used awk to sum up total size of files under a directory (with the help of examples, threads here).
ls -l | awk '/^-/ {total += $5} END {printf "%15.0f\n",total}' >> total.txt
After each execution of the script total result is appended into a text file:
7010
7794
8890 ... (7 Replies)
Discussion started by: EAGL€
7 Replies