10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file, named records.txt, containing large number of records, around 0.5 million records in format below:
28433005 1 1 3 2 2 2 2 2 2 2 2 2 2 2
28433004 0 2 3 2 2 2 2 2 2 1 2 2 2 2
...
Another file is a key file, named key.txt, which is the list of some numbers in the first column of... (5 Replies)
Discussion started by: zenongz
5 Replies
2. Shell Programming and Scripting
Hi All
I would like to modify a file like this:
>antax gioq21 tris notes
abcdefghij
klmnopqrs
>betax gion32 ter notes2
tuvzabcdef
ahgskslsooin this:
>tris
abcdefghij
klmnopqrs
>ter
tuvzabcdef
ahgskslsoo
So, I would like to remove the first two fields(and output field 3) in record... (4 Replies)
Discussion started by: giuliangiuseppe
4 Replies
3. Shell Programming and Scripting
Friends,
I have data sorted on id like this
id addressl
1 abc
2 abc
2 abc
2 abc
3 aabc
4 abc
4 abc
I want to pick all ids with addressesses leaving out duplicate records. Desired output would be
id address
1 abc
2 abc
3 abc
4 abc (5 Replies)
Discussion started by: paresh n doshi
5 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am looking for a simple concise solution most likely using sed to process the following 4 rows of data from the same record and only keeps it if the second record satisfy certain critea such as surname matches up to smith or jackson:
John (firstname)
Smith (surname) ... (21 Replies)
Discussion started by: gjackson123
21 Replies
5. Shell Programming and Scripting
Print only records from file 2 that do not match file 1 based on criteria of comparing column 1 and column 6
Was trying to play around with following code I found on other threads but not too successful
Code:
awk 'NR==FNR{p=$1;$1=x;A=$0;next}{$2=$2(A?A:",,,")}1' FS=~ OFS=~ file1 FS="*"... (11 Replies)
Discussion started by: sigh2010
11 Replies
6. Shell Programming and Scripting
Hello:
I am new to shell script programming. Now I would like to select specific records block from a file. For example, current file "xyz.txt" is containing 1million records and want to select the block of records from line number 50000 to 100000 and save into a file. Can anyone suggest me how... (3 Replies)
Discussion started by: nvkuriseti
3 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have file on below pattern, and i want to write a generic awk to handle all cases.
input_file:
col1~col2~col3~col4~col5~col6
I need to generate 4 files something like this
File1:
col1~~col2~~col3
File2:
col1~~col2~~col4
File3:
col1~~col2~~col5
File4:
col1~~col2~~col6 (1 Reply)
Discussion started by: luckybalaji
1 Replies
8. Shell Programming and Scripting
Dear list
its my first post and i would like to greet everyone
What i would like to do is select records 7 and 11 from each files in a folder then run an executable inside the script for the selected parameters.
The file format is something like this
7 100 200
7 100 250
7 100 300 ... (1 Reply)
Discussion started by: Gtolis
1 Replies
9. Shell Programming and Scripting
New to awk and need some help. I have a script that I would like to make more compact. I want to read a file and grab every field, from every record, except the last field. The records are variable length and have varying number of fields. A record will have at least two fields, but can have... (9 Replies)
Discussion started by: synergy_texas
9 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
I need to select only those records having a non zero record in the first column of a comma delimited file.
Suppose my input file is having data like:
"0","01/08/2005 07:11:15",1,1,"Created",,"01/08/2005"
"0","01/08/2005 07:12:40",1,1,"Created",,"01/08/2005"... (2 Replies)
Discussion started by: shashi_kiran_v
2 Replies