10 More Discussions You Might Find Interesting
1. 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
2. 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
3. Shell Programming and Scripting
Hey folks. I wrote a little awk script that summarizes /proc/net/dev info and then pipes it to the nix column command to set up column spacing appropriately.
Here's some example output:
Iface RxMBytes RxPackets RxErrs RxDrop TxMBytes TxPackets TxErrs TxDrop
bond0 9 83830... (3 Replies)
Discussion started by: ryran
3 Replies
4. 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
5. Linux
Hello,
I am a newbie to linux and struggling to find a better way to append a column in a text file.
Here is the file i want to modify: It has 8 columns (and thousands of rows). I want to append the first column by adding "chr" infront of the numbers. Some rows have a string in the first... (4 Replies)
Discussion started by: bjorngill
4 Replies
6. 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
7. 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
8. Shell Programming and Scripting
Hello All,
I have been searching and trying this for a bit now. Can use some assistance.
Large 5000 line flat file.
bash, rhel5
Input File Sinppet:
Fri Oct 30 09:24:02 EDT 2009 -- 1030
Fri Oct 30 09:26:01 EDT 2009 -- 73
Fri Oct 30 09:28:01 EDT 2009 -- 1220
Fri Oct 30 09:30:01 EDT... (9 Replies)
Discussion started by: abacus
9 Replies
9. 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
10. Shell Programming and Scripting
Hi,
I have a file "input.txt" with the following content :
5312,0,,,1,8,141.2,20090727
3714,0,,,1,8,285.87,20090727
5426,0,,,1,8,3.9,20090727
3871,0,,,1,8,30.4,20090727
9071,0,,,1,8,146.2,20090727
5141,0,,,1,8,2.8,20090727
0460,0,,,1,8,-0.1,20090727
7918,0,,,1,8,-0.1,20090727... (3 Replies)
Discussion started by: valokv
3 Replies