Search Results

Search: Posts Made By: imranrasheedamu
2,802
Posted By RudiC
How about sth along this line? for FN in *.txt ...
How about sth along this line?
for FN in *.txt
do TMP=${FN##*_}
TMP=${TMP%%[0-9]*}
echo "if(filename==$TMP)"
echo count total and unique words
echo
done...
2,802
Posted By joeyg
What have you tried? Also, due to the vague...
What have you tried?

Also, due to the vague nature of this request, it appears that this may be homework/classwork. If it is, there are specific rules relative to schoolwork.
2,946
Posted By Don Cragun
Each call to system() in awk will invoke a shell...
Each call to system() in awk will invoke a shell which will then invoke cp. If there are 6000 files to be copied, invoking one shell for the copies instead of 6000 should be considerably faster. ...
2,946
Posted By RavinderSingh13
Hello imranrasheedamu, Could you please let...
Hello imranrasheedamu,

Could you please let me know if following may help you here.

awk 'NR == FNR #### NR and FNR are the awk's inbuilt variables so condition NR==FNR...
2,946
Posted By RudiC
awk ' NR == FNR {T[$1] ...
awk '
NR == FNR {T[$1] # for the first file (NR id. to FNR), collect the names to search in T array
next #...
2,946
Posted By RudiC
Given my above assumptions apply, try awk...
Given my above assumptions apply, try

awk 'NR == FNR {T[$1]; next} {FN = $0; gsub (/^.*\/|.txt$/, _)} $0 in T {system ("echo cp " FN " /some/where")}' file2 file1
cp ./5_April_2012_Page323.txt...
1,068
Posted By Scrutinizer
Try something like this: awk '{f="file" $1}...
Try something like this:
awk '{f="file" $1} p!=f{if(p)close(f); p=f} ++C[$1]<=4{print >f}' file
The input file needs to grouped on field 1 for this to work. If that is not the case, it needs to be...
1,068
Posted By RavinderSingh13
Hello mranrasheedamu, Could you please try...
Hello mranrasheedamu,

Could you please try following and let me know if this helps you.

awk '{if(++Q[$1]<5){print $0 >> "file"$1} else {close("file"$1)}}' Input_file
Output it created 2...
3,024
Posted By bakunin
If MadeInGermany's suggestion is working for you...
If MadeInGermany's suggestion is working for you save it as "change.sh" (or whatever name you like, the name doesn't particularly matter), add the missing ">" characters as suggested by Aia, make it...
3,024
Posted By Aia
Add the missing > highlighted in red. ...
Add the missing > highlighted in red.




It all depends how much your shell can handle.

Please, try the following.

Save as txt2xmlnews.pl
Run as perl txt2xmlnews.pl file*.txt
or
perl...
3,024
Posted By MadeInGermany
Here is an attempt. Save the following to a file...
Here is an attempt. Save the following to a file "test.sh" and make it executable.
#!/bin/sh
awk '
NR==1 {
print "<heading>"
}
NR==2 {
if (/\./ || length>=80) {
# this looks like text...
Showing results 1 to 11 of 11

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