Hello all,
I have 2 files, the first (indexFile1) contains start offset and length for each record inside the second file. The second file can be very large, each actual record start offset and length is defined by the entry in indexFile1. Since there are no records separators wc-l returns 0 for... (1 Reply)
Hi, I am not sure if this will work or not. I am getting a syntax error.
I am reading fileA, using an acct number field trying to see if it exists in fileB and output to new file. Can anyone tell me if what I am doing will work or should I attempt it another way? Thanks.
exec < "${fileA}... (4 Replies)
Hi everyone,
I was wondering if it's possible to read a file ("file2" in my example) more than once. In this example I want to print file2 entirely for each lines of file1:
awk -F$'\t' '{
print $0
while ((getline < "file2") > 0) {
print "\t"$0
}
}' file1
It... (4 Replies)
Hello,
I've been trying to come up with a solution for the following problem; I have an input file with two columns and I want to print as an output the first column without any changes but for the second column, I want to divide it by its last value. Example input:
1 9
2 10
3 11
4 12
5... (14 Replies)
Hi,
Using this trivial code, I am trying to insert/paste the single column data of a file into the second column (field 2) of a multi-column text file.
awk 'FNR==NR {a=$0; next} {$1=$1 OFS a}1' single-column-file multi-column-file
Lets consider the single-column-file as 'f2' and multi-column... (1 Reply)
Hello,
I have a text file which has list of SQL Commands, from where I have grepped the lines where there is a specific string:
grep <string> <file1> >> <file2>
A sample of the file2 is:
INSERT INTO PS_PWC_SP_ERN_DATA SELECT A.EMPLID ,B.COMPANY ,B.PAYGROUP ,
B.OTH_PAY FROM... (7 Replies)
Hi everyone,
I am trying to write a bash script which reads a data file and does some algebraic operations.
here is the structure of data.xml file that I have;
1 <data>
2 .
3 .
4 .
5 </data>
6 <data>
7 .
8 .
9 .
10</data>
etc.
Each data block contains same number of lines (say... (4 Replies)
Hi Friends,
I am trying to scan line by line using awk and pull the values and pass it in variables and then will use the variables but doesn't work.
Please see below for details.
#more dbtest.sh
----------------------------------
#!/bin/bash
. $HOME/.bash_profile
while read line
do... (6 Replies)
I have a file as below. It contains two data sets separated by >.
I want to pipe each data set to another program called psxy. How
can I get the different records
Have started doing as follows but it only passes the first data set
awk 'BEGIN {RS=">"};{print $0}' p.dat
cat p.dat... (12 Replies)
Dear all,
I am using following function of some script to assign variable "JobNo" some value form file $SAMPLE"_status.log" ( generated using the red color command )
crab ntuplize_crab -status -c $SAMPLE >& $SAMPLE"_status.log" &
echo $SAMPLE"_status.log" "====="
jobNo=$(awk... (10 Replies)