Search Results

Search: Posts Made By: blastit.fr
1,073
Posted By blastit.fr
You should use either curl or wget . If you're...
You should use either curl or wget .
If you're not allowed to install such software, you should try perl with LWP.
See: A Simple way to download many web pages using Perl...
2,203
Posted By blastit.fr
A very short script : $awk -F'[/_]' -vOFS=/...
A very short script :
$awk -F'[/_]' -vOFS=/ '{$10=$10+0 ;print "http:","",$3,"report/latex",$10 ".pdf" }' urls.txt
http://xxx.xx.xxx.xx/report/latex/32.pdf...
3,616
Posted By blastit.fr
What a funny contest. On the same way : $...
What a funny contest.
On the same way :
$ awk 'FNR == 1 && NR != 1{last=NR-1}NR == FNR{next}FNR == 1 || FNR ==last{gsub(",",X)} 1 ' file.txt file.txt
3,616
Posted By blastit.fr
The shortest way : $ awk -v last=$(wc -l...
The shortest way :
$ awk -v last=$(wc -l <file.txt) 'NR==1 || NR==last{gsub(",","")}1' file.txt
1,510
Posted By blastit.fr
Hi The find tool is really the best one for...
Hi
The find tool is really the best one for such process.
See:
$find tmp/ -type f -name '*' -exec echo File name is {} \;

# creation of 2 empty files
$ touch tmp/fileone tmp/filetwo
$ find...
3,814
Posted By blastit.fr
Hi, See this sample running on one input...
Hi,

See this sample running on one input file :

$ cat cont1db.txt
size
waist-(on-half)
hip-(on-half)
inseam
CONTINUE
alt
14"
24-3/4"
34"
CONTINUE
axlt
15"
26-3/4"
34-1/2"
CONTINUE
3,178
Posted By blastit.fr
In your code, I only see one parameter , as < $3...
In your code, I only see one parameter , as < $3 doesn't stand for a parameter.
Did you ever try this :
sqr $2 $3
2,571
Posted By blastit.fr
The operators between ( ) are only for filters ,...
The operators between ( ) are only for filters , not for actions.
See finally my original solution should fit.
You can enhanced it this way
# gzip -q suppresses useless warnings
find /mydir ...
1,691
Posted By blastit.fr
Hi , I have updated my script : see the...
Hi ,
I have updated my script : see the attached file.
This greatly improves resultats , as the rules are changed.

1) The field recognition is nomore based on the line number .
2) The rule to...
1,691
Posted By blastit.fr
Hi, See the attached script as a big...
Hi,

See the attached script as a big enhancement of my previous one.
Now the fields are processed on different criterias, independant of the record number.
The script creates temporary files for...
1,691
Posted By blastit.fr
Hi, Below is a update of the script...
Hi,

Below is a update of the script data2imp.sh with many comments for help.

Regarding any enhancement on the algorithm , I cannot guess what is to be done without seeing the files.

Could...
1,059
Posted By blastit.fr
Here is a sample awk script with updated sample...
Here is a sample awk script with updated sample input sql file.


input file :
$ cat 1.sql
-- sample header
create table emp
( empno integer,
empname char(50))
primary index(empno);
insert...
1,691
Posted By blastit.fr
Hi, See my attached file : this script will...
Hi,
See my attached file : this script will process all files as *.txt in the current directory .
The result file contains one line for each file , with the first field as the original file name.
1,691
Posted By blastit.fr
Hi lxdorney, The script should fit your request...
Hi lxdorney,
The script should fit your request .
#
#data2imp.sh
#we need first to format the input file
awk 'NF{
gsub(/ */," ")
printf "%s" ,$0 ;istext++;next}
istext{print...
2,242
Posted By blastit.fr
Another way is to considere any line whith no...
Another way is to considere any line whith no visible character as a paragraph separator.
Using blank as the default separator , the awk NF variable will by equal to 0 in case you have either blank...
1,691
Posted By blastit.fr
Hi , Could you provide a sample input file and...
Hi ,
Could you provide a sample input file and the expected result ?
2,242
Posted By blastit.fr
Hi, This line works perfectly on your sample...
Hi,

This line works perfectly on your sample file :
awk -v RS='\n\n' '{$1=$1}1' file.txt > ocr.tmp
2,753
Posted By blastit.fr
@Don : typo corrected The behaviour of all...
@Don :
typo corrected
The behaviour of all different grep versions on different unix flavours could be odd. I faced it recently on ibm aix.
2,571
Posted By blastit.fr
the following part of script will compress...
the following part of script will

compress files older than 10 days , except already compressed files
delete compressed files older than 365 days


To be adapted :

#
DIRECTORY=/mydir ...
1,736
Posted By blastit.fr
Sure. Your scripting shell might be ksh and...
Sure.
Your scripting shell might be ksh and your working shell bash.
You can change the shell in your script by adding this in first line

#!/bin/bash

# here comes your commands:
echo ...
2,753
Posted By blastit.fr
On any system: grep -F stands for fgrep ...
On any system:
grep -F stands for fgrep
which is a grep without regexp
as
grep -E stands for egrep

so you shoult try
fgrep -v -x -l -f file1 ...Also considere that the flags are...
1,552
Posted By blastit.fr
@sunnu2u86 As explained, this behaviour...
@sunnu2u86
As explained, this behaviour happens because of your input file .
It seemes you didn't even try my sample script .
2,293
Posted By blastit.fr
my awk version , with results : $ awk -F\| -v...
my awk version , with results :
$ awk -F\| -v OFS=\| '{gsub(/"/,"")}!/XHA|CCD|DDD/{next}$27==""{$27="default value"}1' CATA.csv
Afg|AFG|AF|00|93|||||||7||DDD||||2015-01-13 00:00:00|||412|||||| ...
1,552
Posted By blastit.fr
NF == 25 stands for Number of Fields = 25. ...
NF == 25 stands for Number of Fields = 25.
This is just a filter to avoid processing the header of the file as given in your initial sample ( and mine : node.tmp ) .

The code should run on any...
7,036
Posted By blastit.fr
Hi, You can just use tr to replace null chars...
Hi,
You can just use tr to replace null chars with anything you want , e.g. |
See:
$ od -c 1.tmp
0000000 w e h a v e n u l l \0 \0 \0
0000020 c h a...
Showing results 1 to 25 of 48

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