Search Results

Search: Posts Made By: kcoder24
3,621
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...
3,057
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" ||...
3,853
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.
3,853
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,649
Posted By kcoder24
AWK version awk -F\| 'FNR==1{print...
AWK version


awk -F\| 'FNR==1{print "Welcome "$2}' *.txt
9,509
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)
...
8,022
Posted By kcoder24
This limitant does not exist in gawk
This limitant does not exist in gawk
4,955
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,976
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,838
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...
4,732
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=","
6,141
Posted By kcoder24
Ok thanks Franklin52 :)
Ok thanks Franklin52 :)
2,838
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
2,774
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...
6,141
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
2,774
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...
2,172
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
3,581
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,344
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?
3,704
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,699
Posted By kcoder24
Cheers danmero, I didn't understand your script...
Cheers danmero, I didn't understand your script until I debug it.
1,803
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...
7,451
Posted By kcoder24
My AWK version '/.{32,}/'
My AWK version


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


sed 's/,/ /g'


I typed

sed 's/,/TAB/g'
3,631
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 05:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy