I do have couple of files in a folder. The names of each of the files have a pattern.
Each of the above files have the same pattern of data with 4 columns and have an header for the last 3 columns.
I would like to get a single output file by greping the contents of each of files and a portion of the name of each of the file. More specifically, grep the numerical portion after the '_' in each of the file names, for example, in the file name ahet_005898.txt, get (grep)005898 and also the 2rd column of that file and then paste it horizontally in the result file. Desired out put file is in the matrix format
Please let me know the best way in awk to grep portions of the name of the file and the second column and make a matrix using all the files in a directory.
I tried the following in sed
But it only selects the first column. I am not sure how to extract the file name and print the second column horizontally for all the 1000's of file I have in the directory.
Hi everyone
I am very new at awk but think that that might be the best strategy for this. I have a matrix very similar to a correlation matrix and in practical terms I need to convert it into a list containing the values from the matrix (one value per line) with the first field of the line (row... (5 Replies)
Hi all,
Is there a way to convert full data matrix to linearised left data matrix?
e.g full data matrix
Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7
Bh1 0 0.241058 0.236129 0.244397 0.237479 0.240767 0.245245
Bh2 0.241058 0 0.240594 0.241931 0.241975 ... (8 Replies)
I have a text file, data.txt, which looks like :-
head1 head2 head3
data1 1 data 1 2 data 1 3
data 2 1 data 2 2 data 2 3
data 3 1 data 3 2 data 3 3
etc etc
I would like to print this file, using the lp -d command,
with a heading line, as follows :-
Report for whatever department as... (2 Replies)
I have a file with the information shown and I want to capture the
entry having the rgdt tag and taking the value (the location of the represents the decimal point, for example 0p50 represents 0.50)
I then want to divide the number at the end of each line by the value 0.50
I want to do... (7 Replies)
Hi all - I am trying to write a script to generate a string that gets sent to an IP phone using wget. This is to upload a phone book of up to 100 entries so the string needs to be constructed in one 'hit'. I am a relative newbie to shell scripts but willing to try anything! I have 2 files:
... (3 Replies)
Hello All,
I am a statistician and I am very new to the world of ksh programming. Daily, I analyze millions of rows of data and land information to DB2 tables. I have recently been asked to develop a ksh script to FTP an export file containing line item data from the production environment to the... (2 Replies)
Hi,
I have a series of BASH shell scripts that run together. I would like it so that these scripts construct a log file as they run. This log file would ideally be a text file that contains exactly (including blank lines) what is output to the terminal.
What is the best way to accomplish... (3 Replies)
Hi All,
I'm interested in the best way to serve multiple clients from a server process.
Now, our server is going to serve data on a custom protocol and it is going to get / process that data from a number of possible back-ends including files (text or xml) and MySQL/some other database.... (2 Replies)