selective positions from a datafile - Any Help pls !!!
Hi dear friends,
Im writing a shell script which has to select the strings based on the position.
but the problem is there is no field seperator.
Normally a datafile contains 2000 records (lines) and each line is of size 500 charecters.
I want to select the fields from all the lines which matches the charecter positions.
ex: from position(011:025) position(061:095) position(201:250) position(311:318) position(411:425) position(471:500).
aah I see. I thought OP was meant to select data based on characters from each line, without knowing the columns or having a field separator, therefor I asked for the sample input, it proved to be very dumb though
You can decompoose the input file in records with the fold program.
The following command create split your file in fixed length (500) lines :
You can pipe the result of the command to another command for field extracting :
There is no separator betwen the extracted fields.
If you want someone, ';' for example, you can do :
For a space separator, remove the -v OFS= option.
Another way to split the input file is to use the dd program :
Hi,
I want to be able to read numbers from many files which have the same general form as follows:
C3H8 4.032258004031807E-002
Phi = 1.000000E+00 Tau = 5.749E+00
sL0 = 3.805542E+01 dL0 = 1.514926E-02
Tb = 2.328291E+03 Tu = 3.450E+02 Alpha = ... (3 Replies)
I have two input files 1)datafile 2)metadata file.
I have a metadata file like:
field1datatypeformat1number2string3dateyy-mm-dd
I have a data file like:
1234abc12-8-16 xyz234512-9-163456acd14-08-12
In the first row there is no correction as everything is inline with the metadata.... (3 Replies)
Hi,
I have two files:
first input file is having 7-8 columns,
and second data file is like
I want to arrange my datafile1 in the order given in second data file, by comparing the seconddatafile with the second column of first file and print the entire line....also if any... (2 Replies)
I am attempting to replace positions 44-46 with YYY if positions 48-50 = XXX.
awk -F "" '{if (substr($0,48,3)=="XXX") $44="YYY"}1' OFS="" $filename > $tempfile
But this is not working, 44-46 is still spaces in my tempfile instead of YYY. Any suggestions would be greatly appreciated. (9 Replies)
Hi,
Is there any way we can find out which process is creating a partucular datafile.I know the user and group but i am just curios to know is there any way to find the process.
Thanks (7 Replies)
Hi guys, my supervisor has asked me to solve the problem in 7 days, I've taken 3 days to think about it but couldn't figure out any idea.
Please give me some thoughts with the following problem,
I have index.database that has only index date:
1994
1995
1996
1997
1998
1999
I have... (6 Replies)
I am working on an shell script which checks for all the file starting with abc*.*
and if file found then the filelines need to append the file name in begining
can some one help with the filename appending...
for i in `ls $filename*.csv`
do
echo $i
--- NEED to append file name befor... (3 Replies)
Hi ,,,,
I have move an oracle db from old server to a new server ( solaris 5.9 is the operating system ) my problem is that to new server the datafile ( *.dbf ) are in a different path .....
example
old : /export/home/data/blobs ...........
new /oracle/data/blobs.......
how i can... (3 Replies)
Hi:
First, this is not a homework problem. I just need enough of a hint to get this going...
My datafile (dataf.in) is made up of 10 sections. Each section begins with & and with &&
So it looks like this:-------------------------------------
§ion1
...etc...
&&
§ion2
...etc...... (4 Replies)