07-21-2008
Try with nawk, bawk, mawk, gawk, or XPG4 awk if you have any of those installed on your system.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Wise UNIX Crew,
I want to add 3 different columns to the file in which:
1. The first new column pulls in today's date and time
2. Second column one has a '0'
3. Third column has the word 'ANY' going down the column
If my file content is as follows:
"7","a","abc",123"... (1 Reply)
Discussion started by: dolo21taf
1 Replies
2. Shell Programming and Scripting
not required this time (36 Replies)
Discussion started by: Sandeep_Malik
36 Replies
3. UNIX for Dummies Questions & Answers
Hi
I have a txt file with 4 columns where I need to add 4 empty columns in the middle meaning that I need what is currently column 4 to be column 8 in a new file.
The idea is that I have to use the file as input in a program that reads the data in column 1 and 8, so the content of the other... (8 Replies)
Discussion started by: Banni
8 Replies
4. UNIX for Dummies Questions & Answers
Hi everybody,
I've got two simples file1 like:
aaa aaa aaa
bbb bbb bbb
ccc ccc ccc
and file2 like:
111 111 111
222 222 222
333 333 333
I need to:
1) add a line say "new line" as the first line of the file
2)add a column from file2 (say column3) to file1; the new column should... (14 Replies)
Discussion started by: zajtat
14 Replies
5. Shell Programming and Scripting
Good afternoon to everyone,
I have some input and output from various widgets that I am trying to get to play nicely together. Basically I would like to stay out of excel and be able to automate the entire process. I have read some posts here about how to use awk, nawk, etc, to do similar... (9 Replies)
Discussion started by: LMHmedchem
9 Replies
6. Shell Programming and Scripting
Hi All ,
Kindly help me with this soln
awk '{printf "%s %7s \n", $1,$c}' infile
where
value of variable c I am externally giving input
But executing the above command shows all the columns of infile where as I want only 1st column of infile and 2nd column should print value c (8 Replies)
Discussion started by: Pratik4891
8 Replies
7. Shell Programming and Scripting
Hello,
I have a comma separated flat file. It contains some 20 columns. I want to add two new columns at position 2,3. So that file will have 22 columns. I am providing here sample data with file having 4 columns. Appreciate your help in finding solution for this.
data in input file:... (11 Replies)
Discussion started by: ravi.videla
11 Replies
8. Shell Programming and Scripting
Hi Everyone:
My shell script creates multiple csv files (~30) in for loop. I want to compile (or merge) 3rd column from each (all) of these files to another file (in loop). Please help. Thanks. (3 Replies)
Discussion started by: smap007
3 Replies
9. UNIX for Dummies Questions & Answers
I have a file in which I need to add more columns to based on a key in the first file:
File1
key1,abc,123,
key2,def,456,
key3,ghi,789,
File2
key2,zyx,111,qqq,
key3,yuu,222,www,
key1,pui,333,eee,
key4,xxx,999,rrr,
I would like to create the following output:
Output (1 Reply)
Discussion started by: WongSifu
1 Replies
10. UNIX for Dummies Questions & Answers
Hello,
I am very now to this, hope you can help,
I am looking into editing a file in Solaris, with dinamic collums (lenght varies) and I need 2 things to be made, the fist is to filter the first column and third column from the file bellow file.txt, and create a new file with the 2 filtered... (8 Replies)
Discussion started by: jpbastos
8 Replies