Search Results

Search: Posts Made By: richardsantink
2,278
Posted By RudiC
You wanted to use the date command ... try grep...
You wanted to use the date command ... try
grep -Eo "[A-Z][a-z]* [0-9]{1,2} [0-9]{4}" /tmp/sample.txt |
LC_ALL=C date -f- +"%B %-d %Y:%F" |
awk '
NR == FNR {T[$1] = $2
...
2,278
Posted By vgersh99
awk -f rich.awk myInput.csv where rich.awk is: ...
awk -f rich.awk myInput.csv where rich.awk is:

BEGIN {
FS=OFS=","
mon="January|February|March|April|May|June|July|August|September|October|November|December"
monN=split(mon, monA, "|");
...
1,751
Posted By vgersh99
v=2 awk -v newdate="$(date -d 'now + $v...
v=2
awk -v newdate="$(date -d 'now + $v weeks')" '{print newdate}' myFile
3,358
Posted By Corona688
How about: xargs mkdir < inputfile
How about:
xargs mkdir < inputfile
2,478
Posted By RudiC
It fills translation table T with correct...
It fills translation table T with correct headings ($NF from file1) indexed by non-conforming ones ($1). When done with file1 (titles.txt), it switches the field separator to comma, and works on...
2,478
Posted By RudiC
How about awk 'NR==FNR {T[$1] = $NF; next} $3 in...
How about awk 'NR==FNR {T[$1] = $NF; next} $3 in T {$3 = T[$3]} 1' FS=":" file1 FS="," OFS="," file2
Date,Title,Views,Source
21-05-16,ProdA,this_title_now_conforms,487,YouTube...
1,125
Posted By Skrynesaver
No, you need a list of files with the word house...
No, you need a list of files with the word house in them rather than the "normal" grep output, also you need to provide the filenames as arguments to the tar command...

tar -cvf test.tar $(grep -l...
1,574
Posted By MadeInGermany
Variables are substituted in "double quotes"...
Variables are substituted in "double quotes" only:
StringSub '1s' "${tidyMonth}\/01\/${tidyYear}" 'Date' 'g' 'mysource.csv'
1,576
Posted By Corona688
$0 is a special variable in awk which means "the...
$0 is a special variable in awk which means "the entire line".

NF is a special variable which means "the number of fields", i.e. columns.

So we set the entire line with its current contents,...
1,576
Posted By Corona688
Logically, you should fix the thing which is...
Logically, you should fix the thing which is producing your broken CSV's, not kludge them back together after, but:

awk -F, -v OFS="," 'NR==1 { MINREC=NF; next }
{
if(PREV) { ...
Showing results 1 to 10 of 10

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