10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In a python script I have 2 files printing side by side on the same line. I want to have 1 of the files to be already displayed at once while the other file print down the list in the file and it still will produce new lines. I want to do it like that to reduce printing a lot of lines and... (0 Replies)
Discussion started by: bigvito19
0 Replies
2. Shell Programming and Scripting
hello,
I'm reading this thread, in which there is this code :awk '
function comb(v,i) {
for(i in A) {
delete A;
if(length(A))
comb((v?v"+":x)i)
else print v"+"i
A;
}
}
{ A }
END {
comb();
} ' infilebut I can't understand where does v come... (5 Replies)
Discussion started by: daPeach
5 Replies
3. UNIX for Dummies Questions & Answers
Input:
A|1
B|2
C|3
D|4
Output:
A+B|3
A+C|4
A+D|5
B+C|5
B+D|6
C+D|7
A+B+C|6
A+B+D|7
A+C+D|8
B+C+D|9
A+B+C+D|10
I only managed to get the output for pairs of $1 values (i.e. combination of length 2): (4 Replies)
Discussion started by: beca123456
4 Replies
4. Shell Programming and Scripting
I have a 1-column file such as the example below:
flower
cat
dog
pizza
car
book
I want to create a second column in which all possible 2-item combinations of column one are outputted in 2 tab-separated columns, such as:
flower flower
cat flower
dog flower
pizza ... (5 Replies)
Discussion started by: owwow14
5 Replies
5. Shell Programming and Scripting
Hi
I am relatively new to awk so i am getting confused a lot
I am in need of help ... I am trying to append coloumns to the end of line using AWK
I tried using this command
awk -F "," '{for(s=7;s<=217;s++);$s="0";}1' OFS=, sam_sri_out
It is giving me an output like this...... (1 Reply)
Discussion started by: Sri3001
1 Replies
6. Shell Programming and Scripting
Dear all, could you please help me with awk please?
I have such input:
Input:
a d
b e
c f
The number of lines is unknown before reading the file.
I need to print possible combination between the two columns like this:
Output:
a d
b d
c d
a e
b e
c e
a f (2 Replies)
Discussion started by: irrevocabile
2 Replies
7. Shell Programming and Scripting
Hallo,
i have a file which looks like this:
$1 $2 $3
Student1 55 Pass
55 Pass
35 Fail
Student2 55 Pass
55 Pass
35 Fail
i want that the $1 field... (3 Replies)
Discussion started by: saint2006
3 Replies
8. Shell Programming and Scripting
i have a file containing a line
123456
is it possible to use AWK to print it out to look like
1 2 3 4 5 6 (8 Replies)
Discussion started by: tomjones
8 Replies
9. Shell Programming and Scripting
Hello,
I am trying to write a formatted report into a file using .ksh script and awk. Here is the command I am trying to run
echo "before awk" ${SRC_SCHEMA}
echo | awk '{printf "%-20s", ${SRC_SCHEMA} }' >>$REPORT_SQL_NAME
I get the following error
before awk ADW
awk: 0602-562 Field $()... (1 Reply)
Discussion started by: fastgoon
1 Replies
10. Shell Programming and Scripting
The requirement is to extract 9 fields randomly from a 13 field CSV file to make another CSV file. While doing that, the field 7 and 8 of input csv file should comeout as field 7 of output with the value as first charecters of both 7 and 8 fields of input file(CSV file).
Presently I am using... (1 Reply)
Discussion started by: mitte_dino
1 Replies