10 More Discussions You Might Find Interesting
1. Programming
Hello, I have formatted lines delimited by colon ":", and I need to parse the line into two parts with sscanf() with format specifiers.
infile.txt:
Sample Name: sample1
SNPs : 91
MNPs : 1
Insertions : 5
Deletions ... (13 Replies)
Discussion started by: yifangt
13 Replies
2. Shell Programming and Scripting
Hi All
I am working to process txt file into csv commo separated.
Input.txt
1,2,asdf,34sdsd,120,haahha2
2,2,wewedf,45sdsd,130,haahha
.....
....
Errorcode.txt
120
130
140
myawk.awk code:
{
BEGIN{
HEADER="f1,f2,f3,f4,f5,f6" (4 Replies)
Discussion started by: krsnadasa
4 Replies
3. Shell Programming and Scripting
Hello
Here is an easy one
Data file
12345 (tab) Some text (tab) 53.432
23456 (tab) Some longer text (tab) 933.422
34567 (tab) Some different text (tab) 29.309
I need to awk these three tab-delimited columns so that the first two are unchanged (unformatted) and the third shows two decimal... (1 Reply)
Discussion started by: palex
1 Replies
4. Shell Programming and Scripting
Hi all,
i have written this script:
awk -F';' '
BEGIN {
printf "\n"
printf "\n"
printf "\n"
printf "----------------------------------------------\n"
print " For test "
printf "----------------------------------------------\n"
test_200 = 0
test_300 = 0
test_500 = 0
test_1000 = 0... (11 Replies)
Discussion started by: arrals_vl
11 Replies
5. UNIX for Dummies Questions & Answers
Hi
my awk variable $0 contains the below data
Input file
000001 The Data
000002* The line 2
000003* The line3
output file Req
000001* The Data
000002** The line 2
000003** The line3
one * at column seven needs to be appended to the input lines, (5 Replies)
Discussion started by: rakeshkumar
5 Replies
6. Shell Programming and Scripting
Hi Friends,
I am trying to insert lines of the below format in a file:
# x3a4914 Joe 2010/04/07
# seh Lane 2010/04/07
# IN01379 Larry 2010/04/07
I am formatting the strings as follows using awk printf:
awk 'printf "# %s %9s %18s\n", $2,$3,$4}'
... (2 Replies)
Discussion started by: sugan
2 Replies
7. Shell Programming and Scripting
Hi,
I need to insert a line at a particular line number. I am using the below code:
sed $REV_LINO_NO" i\\
# $CURRENT_DATE $NAME Changed pwd for cindy\'s id" file > file1
This code works, but the formatting is not as I expected. For example, I get lines as shown below... (2 Replies)
Discussion started by: sugan
2 Replies
8. Shell Programming and Scripting
hi all
can any one help me to understand this
bdf -t vfxs | awk '/\//{printf("%-30s%-10s%-10s%-10s%-5s%-10s\n",$1,$2,$3,$4,$5,$6)}'
i want to understand the numbers %-30S% (4 Replies)
Discussion started by: maxim42
4 Replies
9. Shell Programming and Scripting
Hi I'm having a problem with converting a file:
ID X
1 7
1 8
1 3
2 5
2 7
2 2
To something like this:
ID X1 X2 X3
1 7 8 3
2 5 7 2
I've tried the following loop:
for i in `cat tst.csv| awk -F "," '{print $1}'| uniq`;do grep -h $i... (4 Replies)
Discussion started by: flotsam
4 Replies
10. Shell Programming and Scripting
Hi
I'm using awk to manipulate the data in the 6th field of the file xxx_yyy.hrv.
The sample data that is available in this field is given below
220731.7100000000000000
When i tried using this command
cat xxx_yyy.hrv | awk '{printf("%23.16f\n",$6*-1)}'
I get the output as... (4 Replies)
Discussion started by: angelarosh
4 Replies