Hello,
I met a challenge to extract part of the table. I'd like to grep the first three matches based on field1 and field2. Input:
Output
Similar question about picking up the first match was posted before, but this one is more brain-twisting, and I feel there must be a simple script to do the job. Thanks a lot!
Hello,
I am trying to write a bash shell script that does the following:
1.Finds all *.txt files within my directory of interest
2. reads each of the files (25 files) one by one (tab-delimited format and have the same data format)
3. skips the first 10 rows of the file
4. extracts and... (4 Replies)
Hi, I have file1 that contains many columns as show the first three below:
"At1g29930" 198 2105
"At5g46430" 5569 9576
"At1g64740" 1908 2505
"At5g46430" 6717 11317
"At1g64740" 453 655
"At1g12470" 33 18
"At1g80680" 149 262
"At1g23040" ... (3 Replies)
I need to print the second field of a file, taking spaces, tab and = as field separators.
; for 16-bit app support
MAPI=1
CMC=1
CMCDLLNAME32=mapi32.dll
CMCDLLNAME=mapi.dll
MAPIX=1
MAPIXVER=1.0.0.1
OLEMessaging=1
asf=MPEGVideo
asx=MPEGVideo
ivf=MPEGVideo
m3u=MPEGVideo (2 Replies)
I'm trying extract a number of filename fields from a log file and copy them out as separate rows in a text file so i can load them into a table. I'm able to get the filenames but the all appear on one line. I tried using the cut command with the -d (delimiter) option but cant seem to make it... (1 Reply)
Hi,
I am trying to use awk to remove all rows where the first 4 fields are duplicates. e.g. in the following data lines 6-9 would be removed, leaving one copy of the duplicated row (row 5)
Borgarhraun FH9822 ol24 FH9822_ol24_m20 ol Deformed c
Borgarhraun FH9822 ol24 ... (3 Replies)
Hi, i'm been browsing through the threads on how to do looping of multiple lines in awk but havent found the one i needed. I have a data which looks like this below. I need to compute for the monthly average of values per record and i used the awk argument below. how do i tell awk to execute the... (9 Replies)
Hi,
I am trying to execute this line
awk -F ";" -v OFS=";" '{gsub(/\./,",",$6); print}' FILE
but for multiple fields $6 $7 $8
Do you have a suggstion?
Tried:
awk -F ";" -v OFS="";"" "function GSUB( F ) {gsub(/\./,\",\",$F); print} { GSUB( 6 ); GSUB( 7 ); GSUB( 8 ) } 1"... (2 Replies)
Can you please help me with this ....
Input File
share "FTPTransfer" "/v31_fs01/root/FTP-Transfer" umask=022 maxusr=4294967295 netbios=NJ09FIL530
share "Test" "/v31_fs01/root/Test" umask=022 maxusr=4294967295 netbios=NJ09FIL530
share "ENR California" "/v31_fs01/root/ENR California"... (14 Replies)
Hello, I have the following input file:
1 3 3 2
3 3 4 0
4 0 5 4
5 2 2 0
5 3 4 0
6 0 3 2
I am trying to remove all zeroes in fields 2 and 4 and replace them with "1's"
I tried the following, but it's not working
awk -F"\t" '{ if (($2==0) || ($4==0) $2=1; $4=1; print $0 ) }' input
... (8 Replies)
so its common knowledge one can print multiple fields with simple commands like this:
echo 12 44 45 552 24 | awk '{print $1,$4,$3}'
but suppose i want to avoid specifying the "$" symbol. is that possible? can something like this be done:
echo 12 44 45 552 24 | awk '{print $(1,4,3)}'
... (9 Replies)