Hi,
Is there any short method to print from a particular field till another filed using awk?
Example File:
Code:
File1
====
1|2|acv|vbc|......|100|342
2|3|afg|nhj|.......|100|346
Expected output:
[code]
File2
====
acv|vbc|.....|100
afg|nhj|.....|100
[code]
In the above example, let say I have 101 fields, I have print line only from 3 field to 100 field.
Is
Code:
awk '{print $3FS
i have 3 files as below:
Code:
[test1][test2][test3]
i want to print 1st,2nd,5th and 10th filed of 1st to 5th lines from each files into a line of an output file, so the result would be:
[output]:
Code:
{line1}(field 1 of line 1 from file 1)(field 2 of line 1 from file 1)(field 5 of line 1 from file 1)(field 10 of line 1 from file 1)...(field 10 of line 5 from file 1)
{line2}(field 1
Hello All,
I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form
Code:
1|121|asda|434|thesi|2012|05|24|
1|343|unit|09|best|2012|11|5|
I was put into a scenario where I need the field count in all the lines in that file.
Hi,
I have a file of the following format:
Code:
AV 103
AV 104
AV 105
AV 308
AV 517
BN 210
BN 211
BN 212
BN 218
and the desired output is :
Code:
AV 103-105 3
AV 308 1
AV 517 1
BN 210-212 3
BN 218 1
In the output file the first field is the string only.
I have been trying to come up with a program that can do this:
Say I have a file named "sir" with a single field;
Code:
10
229
288
35
83
47
3
I want to create a file "gen" with three fields with the data in file "sire" listed in field 1 while field 2 and 3 are just 1 each like this:
Code:
SPARSE 53000 1 1
10 1 1
229 1 1
288 1 1
35 1 1
83 1 1
47 1 1
3 1 1
Hi all !
I have 2 files:
file1:
Code:
1|AAA|123456
2|BBB|098765432
...
file2:
Code:
-|klk|AAA|$123.00|Qty.2|US
-|opi|EEE|$23.00|Qty.4|US
...
Output:
Code:
1|AAA|-|klk|AAA|$123.00|Qty.2|US
I would need to search the 3rd field of file2 for the patterns contained in the 2nd field of file1.
And then, for the matching lines, return fields 1 and 2 from file1 followed by t
Hello Friends,
I've been working with lots of different CDR-EDR files, before testing i need to manipulate my test files rather than requesting new files(to prepare them for next tests) which are different kind of CDRs,EDRs. In order to do this i might have to change more than a field in a CDR-EDR file, but the code that i could write can just change a position changeable field, not more.
Hi,
I have 2 csv comma separated files with the following fields.
File 1 :
BDUSERID
BDUSERNAME
BDACCESS
File 2 :
BBUSERID
BBKEYWORD
BBACCESS
I need to compare teo files in such a way that if fields BBUSERID and BDUSERID match then display BDUSERNAME and all other fields from
File 2.
If i have a log file record.txt, with 10 fields
- First field is datetime
- 7th field is status
- 8th filed is name
- The last field (10th) is epoch time of the first field
Code:
02/17/2012 1:47 PM||||||In Use|chicken||1329515230
02/17/2012 2:53 PM||||||Available|chicken||1329519195
02/17/2012 3:20 PM||||||In Use|cat||1329520802
02/17/2012 3:22 PM||||||In Use|cat||1329520957
02/17/20