Search Results

Search: Posts Made By: dovah
1,738
Posted By dovah
Conditionally replace field content
Hello

I am trying to conditionally replace field content in $2 of input file if pattern is found in $4 of the same tab-separated input file. Currently, $2 is empty. I am trying (with no success):...
8,891
Posted By dovah
Sorry, I should have mentioned, "doesn't work"...
Sorry, I should have mentioned, "doesn't work" meant that I got empty files :/

Also, I got it working, thanks to one of your previous replies to another post...
8,891
Posted By dovah
Loop awk command on files in a folder
Hi, I'd like to loop an action over all files with given extension within a folder.

The "main" action is: awk -F "\t" 'BEGIN{OFS="\t"}{if ($10=="S") print$0; }' input.txt > output.txt

The...
3,027
Posted By dovah
Awesome, worked like a charm! :)
Awesome, worked like a charm! :)
3,027
Posted By dovah
Merge selective columns from files based on common key
Hi, I am trying to selectively merge two files based on keys reported in the 1st column.

File1:
#file1-header1
file1-header2
111 qwe rtz uio
198 asd fgh jkl
165 yxc...
1,482
Posted By dovah
Thank you so much, it works now :) Awesome!
Thank you so much, it works now :) Awesome!
1,482
Posted By dovah
here's my (failed) attempt $ awk -F"\t"...
here's my (failed) attempt $ awk -F"\t" 'FNR==NR{a[$1]=$2"\t"$3"\t"$4} FNR!=NR{$0=$0"\t"a[$3];print}' file1 file2 > file3
1,482
Posted By dovah
File merging based on column patterns
Hello :)

I am in this situation:

Input: two tab-delimited files, `File1` and `File2`. `File2` (`$2`) has to be parsed by patterns found in `File1` (`$1`).

Expected output: tab-delimited...
1,413
Posted By dovah
Combining sed actions
Let's say I have an input file looking like:
ID1
1 5
6 8
ID2
1 4
5 7
I'm trying to formulate a loop that can combine these actions:
- If the line begins with a letter: replace...
1,418
Posted By dovah
PRE.cjk { font-family: "WenQuanYi Micro...
PRE.cjk { font-family: "WenQuanYi Micro Hei",monospace; }PRE.ctl { font-family: "Lohit Hindi",monospace; }P { margin-bottom: 0.25cm; line-height: 120%; }CODE.cjk { font-family: "WenQuanYi Micro...
1,418
Posted By dovah
P { margin-bottom: 0.25cm; line-height: 120%;...
P { margin-bottom: 0.25cm; line-height: 120%; }CODE.cjk { font-family: "WenQuanYi Micro Hei",monospace; }CODE.ctl { font-family: "Lohit Hindi",monospace; }A:link { } P { margin-bottom:...
1,418
Posted By dovah
Text columns processing using awk
P { margin-bottom: 0.25cm; line-height: 120%; }CODE.cjk { font-family: "WenQuanYi Micro Hei",monospace; }CODE.ctl { font-family: "Lohit Hindi",monospace; }A:link { } I'm trying to build an awk...
1,491
Posted By dovah
Something like this. But it really need a fix, it...
Something like this. But it really need a fix, it doesn't give the expected output.

PRE.cjk { font-family: "WenQuanYi Micro Hei",monospace; }PRE.ctl { font-family: "Lohit...
1,491
Posted By dovah
Text processing using awk
I dispose of two tab-delimited files (the first column is the primary key):

File 1 (there are multiple rows sharing the same key, I cannot merge them)
A 28,29,30,31
A 17,18,19
B ...
Showing results 1 to 14 of 14

 
All times are GMT -4. The time now is 09:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy