How to insert data befor some field in a row of data depending up on values in row
Hi
I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example.
The original data record should be some thing like this
but due to some system errors the file generated has got one missing information and it looks like
both has got 248 charaters length. but in the second record one data is missing i.e 441
i need to insert 441 exactly in that position if 442 is available as next data.
its some thing like case statements...
i will be having different values instead of 442 and their corresponding previous position data
How to go about this...any one help me out...
Am having lot of error files like this to be treated, hence can i do anything like upload in a DB and insert data based on the values in the row at the position i told before (442)
I have a datafile having structure like
col1,col2,col3
col1,col2,col3,col4,col5
col1,col2,col3,col4,col5
.....
Can we take only first row of values from datafile and put into respective variable.
How col1 can be captured in a variable called v_col1 from unix script.
like first row(only)... (1 Reply)
Guys -- I am noob and I am really strugging on this one. I cant even write the pseudo code for it. I have a file that spits values in individual rows as such:
file:
user date type size
joe 2005-25-09 log 1
joe 2005-25-09 snd 10
joe 2005-25-09 rcd 12
joe 2005-24-09 log 2
joe... (1 Reply)
Hello,
I have an input file like the following:
11_3_4
2_1_35
3_15__
_16989
Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Hello,
I want to add a new row to a file to insert data without deleting the previous data there.
Example:
file
a
b
c
d
Output
a
b
newtext
c (6 Replies)
Sorry if I repost my question in this section, but I'm really in a hurry since I have to finish my work... :(
Dear community,
I have a table with two rows like:
Row1 Row2
======= =======
7,3 text 1
1,3 text 2
1,2,3 blabla
What i need to do is add/copy... (2 Replies)
Hi ALL,
We have requirement in a file, i have multiple rows.
Example below:
Input file rows
01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212
01,1,102319,0,1,80,20,U,1,241,00000059420000006021
I need my output file should be as mentioned below. Last field should split for... (4 Replies)
I have the following script that will average the last two fields of each row, but im not sure how to include the 3rd field of the following row.
An example of the analysis that I need to perform from the input - (66.61+58.01+54.16)/3
awk '{sum=cnt=0; for (i=13;i<=NF;i++) { sum+=$i; cnt++... (1 Reply)
Discussion started by: ncwxpanther
1 Replies
LEARN ABOUT DEBIAN
recins
RECINS(1) User Commands RECINS(1)NAME
recins - insert records in a recfile
SYNOPSIS
recins [OPTION]... [t TYPE] [-n NUM | -e EXPR | -q STR | -m NUM] [(-f STR -v STR]|[-R RECDATA)]... [FILE]
DESCRIPTION
Insert new records in a rec database.
-f, --field=STR
field name; should be followed by a -v.
-v, --value=STR
field value; should be preceded by an -f.
-r, --record=STR
record that will be inserted in the file.
--force
insert the record even if it is violating record restrictions.
--no-external
don't use external descriptors.
--no-auto
don't insert auto generated fields.
--verbose
give a detailed report if the integrity check fails.
-s, --password=STR
encrypt confidential fields with the given password.
--help print a help message and exit.
--version
show version and exit.
Record selection options:
-i, --case-insensitive
make strings case-insensitive in selection expressions.
-t, --type=TYPE
operate on records of the specified type only.
-e, --expression=EXPR
selection expression.
-q, --quick=STR
select records with fields containing a string.
-n, --number=NUM,...
select specific records by position, with ranges.
-R, --random=NUM
select a given number of random records.
If no FILE is specified then the command acts like a filter, getting the data from standard input and writing the result to standard out-
put.
AUTHOR
Written by Jose E. Marchesi.
REPORTING BUGS
Report bugs to: bug-recutils@gnu.org
GNU recutils home page: <http://www.gnu.org/software/recutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
COPYRIGHT
Copyright (C) 2010, 2011, 2012 Jose E. Marchesi. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for recins is maintained as a Texinfo manual. If the info and recins programs are properly installed at your site,
the command
info recins
should give you access to the complete manual.
recins 1.4.93 January 2012 RECINS(1)