Reading and appending a row from file1 to file2 using awk or sed
Hi, I wanted to add each row of file2.txt to entire length of file1.txt given the sample data below and save it as new file. Any idea how to efficiently do it. Thank you for any help.
I have an Awk string-compare problem and have searched the internet and forums for a solution i could use but cannot find a solution i understand to make work with my particular problem:
I need to compare (field1 field2 field3 of File1) against (field1 of File2) and if they match print out... (6 Replies)
I'm trying to compare two files using AWK, where if field2 of both files match, replace field1 of file1 with field1 of file2 and if there is no match just print the line of file1.
file1.txt (has empty first field)
:ABBATOM:B:H:1992
:ABBA TROJAN:B:H:1993
:ABBES FIRST HOPE:B:M:1997
:ABBEYS... (4 Replies)
Hi All,
as you can see I'm pretty new to this board. :D
I'm struggling around with small script to search a few fields in another file.
Basically I have file1 looking like this:
15:38:28 sz:10001 pr:14.16
15:38:28 sz:10002 pr:18.41
15:38:29 sz:10003 pr:19.28
15:38:30 sz:10004... (1 Reply)
Hi All,
I have to arrange one of the text file by deleting specific lines.
cat file1.txt
3595 3595 -0.00842773 -0.0085077 0.00368851
12815 12815 -0.00929239 0.00439785 0.0291697
3747 3747 -0.00974353 0.00228922 0.0225058
3574 3574 -0.00711399 -0.00315748 0.0141206
....
12734... (7 Replies)
I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string.
I'm looking to match column1 in file1 to the number... (3 Replies)
Hi.
How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg
file1
1:abc
3:ghi
6:pqr
file2
a abc
b def
c ghi
d jkl
e mno
f pqr
... (6 Replies)
My original files are like this below and I distinguish them from the AP_ID (file1 has 572 and file2 has 544). Also, the header on file1 has “G_” pre-pended. NOTE: these are only snippets of very large files and much of the data is not present here.
Original File 1:
... (36 Replies)
I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited.
I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
Trying to use awk to:
update $2 in file2 with the $2 value in file1, if $1 in file1 matches $13 in file2, which is tab-delimeted. The $2values may already be the same so in that case nothing happens and the next line is processed.
There are exactly 4,605 unique $13 values. Thank you :).
... (4 Replies)
This is a question that is related to one I had last August when I was trying to sort/merge two files by millsecond time column (in this case column 6).
The script (below) that helped me last august by RudiC solved the puzzle of sorting/merging two files by time, except it gets lost when the... (0 Replies)
Discussion started by: aachave1
0 Replies
LEARN ABOUT CENTOS
fipshmac
FIPSHMAC(8) fipshmac FIPSHMAC(8)NAME
fipshmac - create FIPS-140-2 validation checksum files
SYNTAX
fipshmac [-d <directory>] file1 [file2 ...]
DESCRIPTION
fipshmac will create FIPS-140-2 checksum files for all the filenames specified. If the -d option is not specified, checksum files will be
written in the same directory as the file being checksummed. It will prepend a '.' and append '.hmac' to the original file name. When a
directory is specified with the -d option, the '.' will not be prepended and the files are stored into the directory.
If invoked correctly the fipshmac command will not print anything to the standard output or error. Otherwise it will print an error message
to stderr.
The -s option allows to specify the suffix of the hmac file names. The default value .hmac is used when this option is not specified.
RETURN CODES
fipscheck can return the following return codes:
0 OK
2 Missing filename
3 Cannot open the checksum file for writing
4 Cannot read the file to be checksummed, or the checksum computation failed
5 Memory allocation error
6,7 Cannot write to the checksum file
SEE ALSO fipscheck(8), fipscheck.h(3), https://fedorahosted.org/fipscheck/
AUTHOR
Tomas Mraz <tmraz@redhat.com>.
Man page by Paul Wouters <pwouters@redhat.com>
COPYRIGHT
Copyright 2008, 2012 Red Hat, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
fipscheck April 11, 2012 FIPSHMAC(8)