Search Results

Search: Posts Made By: avatar_007
1,157
Posted By RudiC
As you explicitely stated 3 lines to be inserted,...
As you explicitely stated 3 lines to be inserted, try alsoawk '
FNR == 1 {f++
}
f < 3 {line[FNR, f]=$0
next
}
...
1,157
Posted By Don Cragun
If I understood correctly what you specified in...
If I understood correctly what you specified in post #1 in this thread, you might might also want to try something more like:
awk '
FNR == 1 {
# Note start of an input file...
f++
}
{ # Count...
1,157
Posted By sea
0 $ cat main.txt line line0: blödsinn ...
0 $ cat main.txt
line
line0:
blödsinn

line1:

namal blöd
line2:

schluss
0 $ cat paths.txt
/some/path/1
/some/other/path/2
/some/path/3

0 $ bash txt_manip.sh
0 $ cat main.txt...
2,643
Posted By Scrutinizer
You mean skip the first line? awk -F,...
You mean skip the first line?
awk -F, 'NR>1{$1=$1""?p=$1:p}1' OFS=, infile
or more readable (more like CarloM's suggestion):
awk -F, 'NR>1{if($1=="")$1=p; else p=$1}1' OFS=, infile

----

...
3,281
Posted By Scrutinizer
Alternatively try this less general approach: ...
Alternatively try this less general approach:
printf "%s\n" *.dcm | awk -F'[-.]' '$3>p+1{for(i=p+1;i<$3;i++){s=$0; sub($3"."$4,sprintf("%04d",i)"."$4,s); print s}}{p=$3}'
This assumes that all...
3,281
Posted By Corona688
This can detect some kinds of sequences. It...
This can detect some kinds of sequences. It assumes anything with digits and an extension is part of a sequence, and tells different sequences apart from the string before the last set of digits and...
Showing results 1 to 6 of 6

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