Search Results

Search: Posts Made By: kcoder24
2,450
Posted By kcoder24
How to load a hash with a file in Perl
Hi to everybody.

I have a script in AWK with a revursive function, when I make the recursive call I'm loosing values in the local variables. So I'm trying to do the script in Perl, but I don't...
2,612
Posted By kcoder24
My suggestion is: 1.- Monitor the download...
My suggestion is:

1.- Monitor the download process,
2.- If is not present, I supose it has finished
3.- Then I try to unrar the file

1.-
while [ 1 ] ; do
ps | grep "download_process" ||...
2,418
Posted By kcoder24
Thx a lot vgersh99, I'm checking the output, but...
Thx a lot vgersh99, I'm checking the output, but it looks good.
2,418
Posted By kcoder24
AWK Problem in recursive function
Hi, I have a file like this


SPF_HC00001|iCalcular_Monto_Minimo|--->|SPF_HC00028|pstcObtener_Monto_Minimo
SPF_HC00004|iCalcular_Incrementos|--->|SPF_HC00032|pstcObtener_Num_Incrementos...
1,236
Posted By kcoder24
AWK version awk -F\| 'FNR==1{print...
AWK version


awk -F\| 'FNR==1{print "Welcome "$2}' *.txt
5,714
Posted By kcoder24
If you only keep in a buffer the data, why not...
If you only keep in a buffer the data, why not use printf for write directly


{
if (NF==17){
print $0
}else{
fields=NF;
printf("%s", $0)
...
6,853
Posted By kcoder24
This limitant does not exist in gawk
This limitant does not exist in gawk
3,659
Posted By kcoder24
It's easier in awk, can you post an example of...
It's easier in awk, can you post an example of input files?

If you read from two CSV files, then the script it's something like this

awk -F, 'NR==FNR{array[$1];next}{if ($1 in array){print...
2,240
Posted By kcoder24
The option -v make grep to search for everything...
The option -v make grep to search for everything that don't match the regexp, in this case, it prints every line that not contains chars 2, 8 or 9
2,419
Posted By kcoder24
Well, I've added a new param 'paramToSet' to set...
Well, I've added a new param 'paramToSet' to set the field you want to change (or add)


awk -F, -v id=$id -v paramval=$paramval -v paramToSet=$paramToSet '
$2==id{
$paramToSet=paramval
}
1...
3,435
Posted By kcoder24
AWK version awk -F, '{for...
AWK version


awk -F, '{for (i=1;i<=NF;i++){if (v[i,$i]++){$i=""}};print $0}' OFS=","
5,641
Posted By kcoder24
Ok thanks Franklin52 :)
Ok thanks Franklin52 :)
2,419
Posted By kcoder24
Hi. Can you give several examples of the input...
Hi. Can you give several examples of the input data for request modifications?

I think it is possible, at least the way I understand it
1,866
Posted By kcoder24
Then you must modify like this awk -F\|...
Then you must modify like this


awk -F\| 'NR==FNR{f[$1,$2];next}($2SUBSEP$3 in f){print $1"|"$2"|"$6}' filter.txt record.txt


I never made the try with $2,$3 instead $2SUBSEP$3 but you can...
5,641
Posted By kcoder24
Hi Franklin52. Could you explain this part ...
Hi Franklin52. Could you explain this part


xargs -0 grep -l 'TEXT'


I don't understand what exactly is doing -0 and I can't find it with man
1,866
Posted By kcoder24
awk -F\| 'NR==FNR{f[$1];next}($2 in f){print...
awk -F\| 'NR==FNR{f[$1];next}($2 in f){print $1"|"$2"|"$6}' filter.txt record.txt


---------- Post updated at 10:56 AM ---------- Previous update was at 10:31 AM ----------

vgersh99 I've...
1,732
Posted By kcoder24
awk -F\| 'NR==FNR{header[NR]=$0;next}{for...
awk -F\| 'NR==FNR{header[NR]=$0;next}{for (i=1;i<=NF;i++){print header[i] $i}}' HEADER.txt DATAVAL.txt


This might work as you expect
2,727
Posted By kcoder24
Fixing your iriginal sed script sed...
Fixing your iriginal sed script


sed s'/[.][/]//g'


in your original script you say "search for a dot OR slash and replace with nothing"
in this version it says "serach for a dot AND slash...
1,066
Posted By kcoder24
How exactly do you expect the last line, I mean,...
How exactly do you expect the last line, I mean, could you write an example out as you want it?
2,478
Posted By kcoder24
In early sed versions you can run this script ...
In early sed versions you can run this script


sed '1,3d'


I don't remember the option that forces to overwrite the file with the modified text, but I think is -i

---------- Post updated...
3,027
Posted By kcoder24
Cheers danmero, I didn't understand your script...
Cheers danmero, I didn't understand your script until I debug it.
1,417
Posted By kcoder24
What about invert the strings being concatenated...
What about invert the strings being concatenated to get the right order of files,


a=a "FILE_NAME=/core/local/in/"$1" "


in this case you get the extra space character at the end of the...
6,364
Posted By kcoder24
My AWK version '/.{32,}/'
My AWK version


'/.{32,}/'
7,492
Posted By kcoder24
What about sed? sed 's/,/ /g' ...
What about sed?


sed 's/,/ /g'


I typed

sed 's/,/TAB/g'
3,032
Posted By kcoder24
What if you read from stdin instead a named file?...
What if you read from stdin instead a named file? I mean


cat file1 file2 | perl -e '.......'
Showing results 1 to 25 of 44

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