Search Results

Search: Posts Made By: pshields1984
3,079
Posted By pshields1984
Thanks RudiC, I love how your brain went there to...
Thanks RudiC, I love how your brain went there to "trick" CONVFMT and I never knew a carry flag. I have tried your suggestion and it works brilliantly. My input file works in tandem with your...
3,079
Posted By pshields1984
awk - Adding and Subtracting Numbers from 2 Columns
Hi Folks,

I have a file with 2 columns TAB delimited and I want to add '1' to the first column and subtract '-1' from the second column.

What I have tried so far is;

awk -F"\t" '{...
2,980
Posted By pshields1984
Thanks Yoda, it works perfectly for me.
Thanks Yoda, it works perfectly for me.
2,980
Posted By pshields1984
That works perfectly Yoda, many thanks. How can I...
That works perfectly Yoda, many thanks. How can I turn your example into a one-liner? Is that possible? I've tried awk -F'\t' 'NR == FNR {m[$1] = $0; next} {if ( $1 in m )$0 = m[$1] else $0 = $1 OFS...
2,980
Posted By pshields1984
Vlookup using awk
Hi folks,

awk 'NR==FNR {m[$1]=$0; next} $1 in m{$0=m[$1]} {print}' file2 file1

Works a charm for a vlookup type query, sourced from...
5,574
Posted By pshields1984
Thank you RudiC. It worked a charm. ...
Thank you RudiC. It worked a charm.

---------- Post updated at 06:34 PM ---------- Previous update was at 02:18 PM ----------

Thanks Aia I'll give the perl suggestion a go.
5,574
Posted By pshields1984
Thank you so much, I am almost there. Long time...
Thank you so much, I am almost there. Long time lurker first time poster, apologies about quoting code correctly. Can you explain the command? I don't really need column headers to make things more...
5,574
Posted By pshields1984
Count and keep duplicates in Column
Hi folks,

I've got a csv file called test.csv

Column A Column B
Apples 1900
Apples 1901
Pears 1902
Pears 1903I want to count and keep duplicates in the first column....
Showing results 1 to 8 of 8

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